PHP installation problems

Source: Internet
Author: User
Tags phpinfo server error log


Install
This section describes the most common problems during installation. PHP is applicable to almost any OS (except for MACOs before OSX) and almost any web server.
To install PHP, follow the instructions on the installation file in the release version. Windows users should also read the install.txt file. Here are some help documents. 1. UNIX/Windows: Where should I put my PHP. ini? 2. UNIX: I installed PHP, but every time I load a document, I will get the following message: 'document contains no data '! What's going on? 3. UNIX: I use 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 support database compilation! What should I do? 5. UNIX: I used the FrontPage extension package to patch Apache and suddenly PHP stops working. Is the PHP and Apache FrontPage packages incompatible? 6. UNIX/Windows: I installed PHP, but when I looked at my PHP page in a browser, there was a blank space. 7. UNIX/Windows: I installed PHP, but when I looked at my PHP page in a browser, I got a server 500 error. 8. some Operating Systems: I have no error in installing PHP, But when I start Apache, I get 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 in the browser, view my PHP page and 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 follow the install requirements, but I still cannot allow my PHP to work under IIS.
1. UNIX/Windows: Where should I put my PHP. ini file?
In UNIX, it should be stored in the/usr/local/lib directory by default. This is its <install-path>/lib. Many people will change it during compilation and use the -- with-config-file-path flag. For example, you can set it as follows:

-- With-config-file-Path =/etc then you can copy the sourceProgramPHP. ini-Dist in the package to/etc/PHP. ini, edit it to meet your localization needs.
PHP in windows. the default INI path is the Windows directory. if you are using Apache webserver, PHP. INI is first searched in the installation directory of Apaches, for example, c: \ Program Files \ apache group \ apache. in this way, you can have different PHP. INI corresponds to different versions of Apache (on the same machine ).
For more details, refer to configuration file.
2. UNIX: I installed PHP, but every time I load a document, I will get the following message: 'document contains no data '! What's going on?
This may be because of a core-dumping error in your php. Search for your server error log file 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 to solve this problem. If you are using PHP as the Apache module, follow these steps:

Stop the HTTPd process

GDB httpd

Stop the HTTPd process

> Run-X-F/path/to/httpd. conf

Browse the URL that you just failed

> Run-X-F/path/to/httpd. conf

If you still have core dump, GDB will notify you now

Entry: BT

Your bug report should contain backtrace. These will be sent to the http://bugs.php.net/

If your script uses the Regular Expression Function (ereg () and friends), make sure that you compile PHP and Apache using the same regular expression package. The PHP and Apache 1.3.x processes automatically.
3. UNIX: I use RPMs to install PHP, but Apache does not support PHP pages! What should I do?
If you have installed Apache and PHP (from rpm), you need to comment out or add some lines in your HTTP. conf file:

# Extra modulesaddmodule modules # extra export php_module modules/export 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 full area, or to the virtual domain that you want to support PHP.
4. I used RPMs to install PHP 3, but it is not supported by the database options I need! What should I do?
Because of the built-in support relationships of PHP 3, it is quite difficult to compile a complete php rpm suitable for all applications. This was mentioned in PHP 4. For PHP 3, we recommend that you use the mechanism described in install. RedHat (in the PHP package. If you must use PHP 3 of rpm, read...
The RPM package manager sets RPMs for simple installation, without database support and because RPMs uses/usr/instead of the standard/usr/local/directory to store files. you need to tell the RPM file which database you want to support and the location of their parent directory.
The following example explains how to support MySql in Apache mode.
Of course, all of these can be slightly modified to support other PHP-supported databases. We assume that you have installed MySQL and Apache, which are completely installed using RPMs.

First, remove mod_php3:

Rpm-e mod_php3

Then obtain and install the RPM package, instead of re-compiling.

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 \ % 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 change, re-compile 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 better than getting a new PHP 3 tarball.CodeIt is much easier to follow the install. RedHat instructions step by step.

5. UNIX: I used the FrontPage extension package to patch Apache and suddenly PHP stops working. Is the PHP and Apache FrontPage packages incompatible?
No. php and FrontPage Extensions run well .. The problem is that the FrontPage package modifies several Apache structure parameters, and PHP needs to use them. after the FrontPage extension package is added, re-compile PHP (use 'make clean; make') to solve this problem.
6. UNIX/Windows: I installed PHP, but when I looked at my PHP page in a browser, there was a blank space.
Use 'view source files' in the browser to view your script. You may find that you see the source program. This indicates that the Web server does not send scripts to PhP for execution. It must have been an error in the server configuration. Carefully check the server configurations installed in PHP.
7. UNIX/Windows: I installed PHP, but when I looked at my PHP page in a browser, I got a server 500 error.
This error occurs when the server is running PHP. To see the readable error message, change the directory to the directory (php.exe windows) on the command line and run php-I. if you have any questions, the detailed error information will be displayed, which will tell you what to do next. If you get the HTML code (phpinfo () function output) on the full screen, PHP works normally. This error is caused by server configuration and should be checked carefully.
8. Some Operating Systems: I have not encountered any errors when installing PHP, 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 is not related to PhP, but to the mysql client library. -- With-zlib: some operating systems are required, but some do not. The MySQL FAQ already describes this issue.
9. Windows: I installed PHP, but read my PHP page in the browser and 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 because PHP does not produce any output at all. To see the readable error message, change the directory to the directory (php.exe windows) on the command line and run php-I. if you have any questions, the detailed error information will be displayed, which will tell you what to do next. If you get the full screen HTML code (the output of the phpinfo () function), PHP works normally.
Once PHP works in command line mode, check whether your script program still fails because of the following reasons:

Permission for your PHP script. Php.exe, php4ts. dll, PHP. ini, or any PHP file that you may load must be accessible by an anonymous Internet user isur _ <machinename>.

The script file does not exist at all (or is not the location you think .) Note that you can block this error in IIS by selecting the 'check file exists' box when setting the script ing directory. If the script does not exist, the server returns a 404 error. This also has some other advantages, that is, IIS only performs authorized operations for you.
10. Windows: I strictly follow the install requirements, but I still cannot allow my PHP to work in IIS.
Are you sure you want to run php users with the permission to operate php.exe! IIS uses an anonymous Internet user, which is automatically added When IIS is installed. This user needs the permission to operate php.exe. In addition, any user who needs authorization must also have the permission to access php.exe. In IIS4, you need to tell it that PHP is a script engine.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.