Installation
This section describes the most common problems during the installation process. PHP is suitable for almost any OS (except perhaps OSX prior to MacOS), and almost any Web server.
To install PHP, follow the instructions in the release version of the installation files. Windows users should also read install.txt files. There are also some help documents 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 use RPMS to install PHP, but Apache does not support PHP page! What to do? 4. Unix: I use RPMS to install PHP 3, but it does not have the database compilation support I need! What am I going to do? 5. Unix: I patched Apache with the FrontPage extension package, and suddenly PHP stopped working. is PHP and Apache FrontPage package incompatible? 6. Unix/windows: I installed PHP, but in the browser to see my php page, blank. 7. Unix/windows: I installed PHP, but in the browser to see my php page, I get a server error. 8. Some operating systems: I installed PHP without error, but when I started Apache, I got a undefined symbol errors: [MYBOX:USER/SRC/PHP4] root# apachectl configtest APACHEC TL:/usr/local/apache/bin/httpd Undefined symbols: _compress _uncompress9. Windows: I installed PHP, but in the browser to see my php page, get the following error: CGI error:the specified CGI application misbehaved by not returning a complete s Et of HTTP headers. The headers it did return are:10. Windows: I strictly follow the install requirements, but still can't let my PHP work under IIS.
1. Unix/windows: Where should my php.ini file be placed?
UNIX under the default it should be placed in the/usr/local/lib directory. That's it's /lib. Many people will change it at compile time, using the--WITH-CONFIG-FILE-PATH flag. For example, you can set it up 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 meet your localization needs.
The default path under Windows PHP.ini is the Windows system directory. If you are using Apache webserver, php.ini is first found in the Apaches installation directory, for example: C:\Program Files\apache Group\apache. This way you can have different php.ini corresponding to different versions of Apache (on the same machine).
Please refer to 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 due to a core-dumping error in your PHP. Find your server error log file to see if this is the case. Then report this error. If you know how to use ' gdb ', you can provide a backtrace in your bug report. This will be a great help to the developer in solving this problem. If you are using PHP as an Apache module, follow the steps below:
Stop the HTTPD process
GDB httpd
Stop the HTTPD process
> Run-x-f/path/to/httpd.conf
Browse to the URL you just made a mistake
> Run-x-f/path/to/httpd.conf
If you still have core dump, GDB will now notify you
Enter: BT
You should include BackTrace 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 that you compile PHP and Apache with the same regular expression package. In PHP and Apache 1.3.x This process is done automatically.
3. Unix: I use RPMS to install PHP, but Apache does not support PHP page! What to do?
Assuming you installed Apache and PHP (from RPM), you need to counter-annotate or add some lines in your http.conf file: # Extra Modulesaddmodule mod_php.caddmodule Mod_php3.caddmod Ule 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 virtual domain that you want to support PHP.
4. I use RPMS to install PHP 3, but it does not have the database options I need to support! What am I going to do?
Because of the built-in support for PHP 3, it is quite difficult to compile a full PHP rpm that is suitable for all applications. This is mentioned in PHP 4. For PHP 3, we have to suggest that you use Install.redhat (in PHP package) to describe the mechanism. If you are sure to use the RPM version of PHP 3, read ...
RPM Package Manager Settings RPMS 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 what kind of database you want to support and the location of their most advanced directories.
The following example explains how to support the Access database MySQL in Apache mode.
Of course all of these can be modified slightly to support other PHP supported databases. Let's say you installed MySQL and Apache, which is completely installed with 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/usr/src/redhat/specs/mod_php3.spec File
In the%build section, add the database support you want, along with the path information.
For MySQL you should add:--WITH-MYSQL=/USR \%build section looks like:./configure--prefix=/usr \--with-apxs=/usr/sbin/apxs \--with-config-fi Le-path=/usr/lib \--enable-debug=no \--enable-safe-mode \--with-exec-dir=/usr/bin \--with-mysql=/usr \-- With-system-regex
After the change is complete, rpm:rpm-bb/usr/src/redhat/specs/mod_php3.spec as follows
Then install the RPM rpm-ivh/usr/src/redhat/rpms/i386/mod_php3-3.0.5-2.i386.rpm restart Apache, you have got the support of MySQL under RPM. Notice that this approach is more than you get a PHP 3 tarball code, according to the INSTALL. REDHAT's guidelines are much easier to do in a step-by-step way.
5. Unix: I patched Apache with the FrontPage extension package, and suddenly PHP stopped working. is PHP and Apache FrontPage package incompatible?
No, PHP and FrontPage extension packages work well. The problem is that the FrontPage package modifies several Apache structure parameters, and PHP uses them. After the FrontPage extension package is hit, recompiling php (using ' make clean; make ') will solve the problem.
6. Unix/windows: I installed PHP, but in the browser to see my php page, blank.
Look at your script in the browser with ' view source ', you may find that you are seeing the source program. This means that the Web server does not send scripts to PHP to execute. There must be something wrong with the server configuration. Carefully check the server configuration for the PHP installation.
7. Unix/windows: I installed PHP, but in the browser to see my php page, I get a server error.
This is an error that occurred when the server was running PHP. In order to see the readable error message, on the command line, change the directory to the directory where (Php.exe Windows), run php-i. If there is any problem, the detailed error message is displayed, and it will tell you what to do next. If you get full-screen HTML code (the output of the Phpinfo () function), then PHP works properly, and this error is caused by the server configuration and should be checked carefully.
8. Some operating systems: I installed PHP without error, but when I started Apache, I got a undefined symbol errors: [MYBOX:USER/SRC/PHP4] root# apachectl configtest APACHEC TL:/usr/local/apache/bin/httpd Undefined symbols: _compress _uncompress
This issue is not related to PHP, but to the MySQL client library. --with-zlib, some operating systems are needed, while others are not needed. The MySQL FAQ already tells the question.
9. Windows: I installed PHP, but in the browser to see my php page, get the following error: CGI error:the specified CGI application misbehaved by not returning a complet E Set of HTTP headers. The headers it did return is:
This is because PHP does not produce any output at all. In order to see the readable error message, on the command line, change the directory to the directory where (Php.exe Windows), run php-i. If there is any problem, the detailed error message is displayed, and it will tell you what to do next. If you get full-screen HTML code (the output of the Phpinfo () function), then PHP works fine.
Once PHP is working in command-line mode, and then look at your script, it still fails, possibly for the following reasons:
Permission to your PHP script. Php.exe, Php4ts.dll, php.ini or any PHP file you might be loading, it must be anonymous Internet users isur_ access. The
script file does not exist at all (or is not where you think it is). Note that in IIS, you can block this error by selecting the ' Check file exists ' box when setting the script map directory. This way, if the script does not exist, the server returns a 404 error. There are other benefits to doing so, which is that IIS is only authorized to do this for you.
Windows: I do exactly as required by the install, but I still can't get my PHP to work under IIS. The
determines that any user who wants to run PHP has permission to operate Php.exe! IIS uses anonymous Internet users, which are automatically incremented when IIS is installed. This user is required to manipulate Php.exe permissions. Also, any user who needs authorization must also have access to the Php.exe. Under IIS4, you have to tell it that PHP is a scripting engine.
http://www.bkjia.com/phpjc/313915.html www.bkjia.com true http://www.bkjia.com/phpjc/313915.html techarticle Installation This section describes the most common problems during the installation process. PHP is suitable for almost any OS (except perhaps OSX prior to MacOS), and almost any Web server. To install PHP, follow ...