PHP installation question _ PHP Tutorial-php Tutorial

Source: Internet
Author: User
Tags server error log
PHP installation problems. 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. Install PHP
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 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 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 header S. The headers it did return are: 10. Windows: I strictly follow The install requirements, but 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 /Lib. many people will change it during compilation and use the -- with-config-file-path flag. For example, you can set it like this: -- with-config-file-path =/etc and then you can copy the php. ini-dist 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. in the 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/* PHP 3 */AddType application/x-httpd-php. php/* for PHP 4 */... to the full local 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 get the rpm Package and install it, not -- recompile the 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 to look 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 modification, re-compile the rpm as follows: rpm-bb/usr/src/redhat/SPECS/mod_php3.spec
Then install the rpm-ivh/usr/src/redhat/RPMS/i386/mod_php3-3.0.5-2.i386.rpm restart Apache, you have gained support for Mysql under rpm. Note that this is much easier than getting a new PHP 3 tarball code, as instructed by INSTALL. REDHAT.

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 no error in 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 checked my PHP page in The browser and got 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 able to be accessed by the anonymous internet user ISUR _ Access.
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.

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 steps...

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.