search
HomeBackend DevelopmentPHP TutorialPHP installation problems_PHP tutorial

PHP installation problems_PHP tutorial

Jul 21, 2016 pm 04:11 PM
phpInstallWillcommonofprocessquestion


Installation
This section will describe the most common problems during the installation process. PHP is suitable for almost any OS (except perhaps MacOS before OSX), and almost any WEB server.
To install PHP, follow the instructions in the installation file included with your distribution. Windows users should also read the install.txt file. There is also some help documentation here. 1. Unix/Windows: Where should I put my php.ini? 2. Unix: I installed PHP, but every time I load a document, I get the following message: 'Document Contains No Data'! What's going on? 3. Unix: I used RPMS to install PHP, but Apache does not support PHP pages! What should I do? 4. Unix: I used RPMS to install PHP 3, but it does not have the database compilation support I need! What should I do? 5. Unix: I patched Apache with the FrontPage extension pack, and suddenly PHP stopped working. Is PHP and Apache FrontPage packages incompatible? 6. Unix/Windows: I installed PHP, but when I view my PHP page in the browser, it is blank. 7. Unix/Windows: I installed PHP, but when I viewed my PHP page in the browser, I got a server 500 error. 8. Some operating systems: I installed PHP without error, but when I started Apache, I got an undefined symbol errors: [mybox:user /src/php4] root# apachectl configtest apachectl: /usr/local/apache/bin/httpd Undefined symbols: _compress _uncompress9. Windows: I installed PHP, but when I look at my PHP page in the browser, I get The following error: cgi error: The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:10. Windows: I strictly followed the install requirements, but I still can't get my php to work under IIS.
1. Unix/Windows: Where should my php.ini file be placed?
By default under UNIX it should be placed in the /usr/local/lib directory. This is its /lib. Many people will change this at compile time, using the --with-config-file-path flag. For example, you can set it like this: --with-config-file-path=/etc You can then copy the php.ini-dist from the source package to /etc/php.ini and edit it to suit your localization needs.
The default path of php.ini under Windows is the Windows system directory. If you are using Apache webserver, php.ini will first be found in the Apache installation directory, for example: c:program filesapache groupapache. This way you can have different The php.ini corresponds to different versions of Apache (on the same machine).
Please refer to the configuration file for more details.
2. Unix: I installed PHP, but every time I load a document, I get the following message: 'Document Contains No Data'! What's going on?
This may be because your PHP is experiencing a core-dumping error. Check your server error log files to see if this is the case. Then report the error. If you know how to use 'gdb', you can provide a backtrace in your error report. This will be of great help to developers in solving this problem. If you are using PHP as an Apache module, please follow the steps below:

Stop the httpd process
gdb httpd
Stop httpd process
> run -X -f /path/to/httpd.conf
Browse the URL you just made an error with
> run -X -f /path/to/httpd.conf
If you still have core dump, gdb will now notify you
Type: bt
Backtrace should be included in your bug report. These will be sent to http://bugs.php.net/

If your script uses regular expression functions (ereg() and friends), you should make sure you compile PHP and Apache using The same regular expression package. In PHP and Apache 1.3.x this process is automated.
3. Unix: I used RPMS to install PHP, but Apache does not support PHP pages! What should I do?
Assuming you installed Apache and PHP (from RPM), you need to uncomment or add some lines in your http In the .conf file: # Extra ModulesAddModule mod_php.cAddModule mod_php3.cAddModule mod_perl.c# Extra ModulesLoadModule php_module modules/mod_php.soLoadModule php3_module modules/libphp3.so /* for PHP 3 */LoadModule php4_module modules/libphp4.so /* for PHP 4 */LoadModule perl_module modules /libperl.soAnd add: AddType application/x-httpd-php3 .php3 /* for PHP 3 */AddType application/x-httpd-php .php /* for PHP 4 */... to the global domain, or to the PHP you want to support in the virtual domain.
4. I used RPMS to install PHP 3, but it does not support the database options I need! What should I do?
Because of the built-in support of PHP 3, compile a complete PHP that is suitable for all applications RPM is quite difficult. This is discussed in PHP 4. For PHP 3, we can only recommend that you use the mechanism described by INSTALL.REDHAT (in the PHP package).If you must use the RPM version of PHP 3, read...
RPM Package Manager Setup RPMS Simple installation, without database support and because RPMS uses /usr/ instead of the standard /usr/local/ directory storage File. You need to tell the RPM file which databases you want to support and the location of their top-level directory.
The following example will explain how to support the popular database Mysql in Apache mode.
Of course all of these can be slightly modified to support other PHP supported databases. We assume that you have MySQL and Apache installed entirely using RPMS.

First, remove mod_php3: rpm -e mod_php3
Then get the rpm package and install it, not --recompile rpm -Uvh mod_php3-3.0.5-2.src.rpm
Edit the /usr/src/redhat/SPECS/mod_php3.spec file
Add the database support and path information you want in the %build section.
For MySQL you should add: --with-mysql=/usr The %build section looks like: ./configure --prefix=/usr --with-apxs=/usr/sbin/apxs --with-config-file-path=/usr/lib --enable-debug=no --enable-safe-mode - -with-exec-dir=/usr/bin --with-mysql=/usr --with-system-regex
After the changes are completed, reprogram the rpm as follows: rpm -bb /usr/src/redhat/SPECS/mod_php3.spec
Then install the rpm rpm -ivh /usr/src/redhat/RPMS/i386/mod_php3-3.0.5-2.i386.rpm Restart Apache, you have got support for Mysql under rpm. Note that this approach is much easier than re-obtaining a PHP 3 tarball code and following the step-by-step instructions of INSTALL.REDHAT.

5. Unix: I patched Apache with the FrontPage extension pack, and suddenly PHP stopped working. Are PHP and Apache FrontPage packages incompatible?
No, PHP and FrontPage extension packages work just fine. The problem is that the FrontPage package modifies several Apache structural parameters, and PHP uses them. After the FrontPage extension package is added, recompiling PHP (using 'make clean; make') will solve this problem.
6. Unix/Windows: I installed PHP, but when I view my PHP page in the browser, it is blank.
Use 'View Source' to view your script in the browser, you may find that what you see is the source program. This means that the web server does not send the script to PHP for execution. There must be something wrong with the server configuration. Double check the server configuration of your PHP installation.
7. Unix/Windows: I installed PHP, but when viewing my PHP page in the browser, I got a server 500 error.
This is a server error when running PHP. To see readable error messages, on the command line, change directories to the directory where php.exe (Windows) is located and run php -i. If there are any problems, detailed error messages will be displayed and it will tell you what to do next. What to do. If you get a screen full of HTML code (the output of the phpinfo() function), then PHP is working fine and the error is caused by the server configuration and should be checked carefully.
8. Some operating systems: I installed PHP without errors, but when I started Apache, I got an undefined symbol errors: [mybox:user /src/php4] root# apachectl configtest apachectl: /usr/local/apache/bin/httpd Undefined symbols: _compress _uncompress
This problem actually has nothing to do with PHP, but with the MySQL client library. --with-zlib, some operating systems require it, but some don't. The MySQL FAQ already covers this issue.
9. Windows: I installed PHP, but when I look at my PHP page in the browser, I get the following error: cgi error: The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:
This is PHP producing no output at all. To see readable error messages, on the command line, change directories to the directory where php.exe (Windows) is located and run php -i. If there are any problems, detailed error messages will be displayed and it will tell you what to do next. What to do. If you get a screen full of HTML code (the output of the phpinfo() function), then PHP is working fine.
Once PHP is working in command line mode, take a look at your script. It still fails, probably because of the following reasons:

Permissions for your PHP script. php.exe, php4ts.dll, php.ini or any PHP file you may load must be accessible to the anonymous internet user ISUR_.
The script file does not exist at all (or is not where you think it is.) Please note that in IIS, you can block this error by checking the 'check file exists' box when setting up the script mapping directory. In this way, if the script does not exist, the server will return a 404 error. Doing this also has other benefits, that is, IIS only performs authorized operations for you.
10. Windows: I strictly followed the install requirements, but I still can’t get my php to work under IIS.
Make sure that any user who wants to run PHP has the permission to operate php.exe! IIS uses anonymous internet users, which are automatically added by the system when IIS is installed. This user needs permission to operate php.exe. Additionally, any user requiring authorization must also have permission to access php.exe.Under IIS4, you have to tell it that PHP is a script engine.​

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/313915.htmlTechArticleInstallation This section will describe the most common problems during the installation process. PHP is suitable for almost any OS (except perhaps MacOS before OSX), and almost any WEB server. To install PHP, follow...
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
PHP Email: Step-by-Step Sending GuidePHP Email: Step-by-Step Sending GuideMay 09, 2025 am 12:14 AM

PHPisusedforsendingemailsduetoitsintegrationwithservermailservicesandexternalSMTPproviders,automatingnotificationsandmarketingcampaigns.1)SetupyourPHPenvironmentwithawebserverandPHP,ensuringthemailfunctionisenabled.2)UseabasicscriptwithPHP'smailfunct

How to Send Email via PHP: Examples & CodeHow to Send Email via PHP: Examples & CodeMay 09, 2025 am 12:13 AM

The best way to send emails is to use the PHPMailer library. 1) Using the mail() function is simple but unreliable, which may cause emails to enter spam or cannot be delivered. 2) PHPMailer provides better control and reliability, and supports HTML mail, attachments and SMTP authentication. 3) Make sure SMTP settings are configured correctly and encryption (such as STARTTLS or SSL/TLS) is used to enhance security. 4) For large amounts of emails, consider using a mail queue system to optimize performance.

Advanced PHP Email: Custom Headers & FeaturesAdvanced PHP Email: Custom Headers & FeaturesMay 09, 2025 am 12:13 AM

CustomheadersandadvancedfeaturesinPHPemailenhancefunctionalityandreliability.1)Customheadersaddmetadatafortrackingandcategorization.2)HTMLemailsallowformattingandinteractivity.3)AttachmentscanbesentusinglibrarieslikePHPMailer.4)SMTPauthenticationimpr

Guide to Sending Emails with PHP & SMTPGuide to Sending Emails with PHP & SMTPMay 09, 2025 am 12:06 AM

Sending mail using PHP and SMTP can be achieved through the PHPMailer library. 1) Install and configure PHPMailer, 2) Set SMTP server details, 3) Define the email content, 4) Send emails and handle errors. Use this method to ensure the reliability and security of emails.

What is the best way to send an email using PHP?What is the best way to send an email using PHP?May 08, 2025 am 12:21 AM

ThebestapproachforsendingemailsinPHPisusingthePHPMailerlibraryduetoitsreliability,featurerichness,andeaseofuse.PHPMailersupportsSMTP,providesdetailederrorhandling,allowssendingHTMLandplaintextemails,supportsattachments,andenhancessecurity.Foroptimalu

Best Practices for Dependency Injection in PHPBest Practices for Dependency Injection in PHPMay 08, 2025 am 12:21 AM

The reason for using Dependency Injection (DI) is that it promotes loose coupling, testability, and maintainability of the code. 1) Use constructor to inject dependencies, 2) Avoid using service locators, 3) Use dependency injection containers to manage dependencies, 4) Improve testability through injecting dependencies, 5) Avoid over-injection dependencies, 6) Consider the impact of DI on performance.

PHP performance tuning tips and tricksPHP performance tuning tips and tricksMay 08, 2025 am 12:20 AM

PHPperformancetuningiscrucialbecauseitenhancesspeedandefficiency,whicharevitalforwebapplications.1)CachingwithAPCureducesdatabaseloadandimprovesresponsetimes.2)Optimizingdatabasequeriesbyselectingnecessarycolumnsandusingindexingspeedsupdataretrieval.

PHP Email Security: Best Practices for Sending EmailsPHP Email Security: Best Practices for Sending EmailsMay 08, 2025 am 12:16 AM

ThebestpracticesforsendingemailssecurelyinPHPinclude:1)UsingsecureconfigurationswithSMTPandSTARTTLSencryption,2)Validatingandsanitizinginputstopreventinjectionattacks,3)EncryptingsensitivedatawithinemailsusingOpenSSL,4)Properlyhandlingemailheaderstoa

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version