Home Backend Development PHP Tutorial PHP installation problems_PHP tutorial

PHP installation problems_PHP tutorial

Jul 21, 2016 pm 04:11 PM
php Install Will common of process question


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 of this Website
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

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

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian Dec 24, 2024 pm 04:42 PM

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

7 PHP Functions I Regret I Didn't Know Before 7 PHP Functions I Regret I Didn't Know Before Nov 13, 2024 am 09:42 AM

If you are an experienced PHP developer, you might have the feeling that you’ve been there and done that already.You have developed a significant number of applications, debugged millions of lines of code, and tweaked a bunch of scripts to achieve op

How To Set Up Visual Studio Code (VS Code) for PHP Development How To Set Up Visual Studio Code (VS Code) for PHP Development Dec 20, 2024 am 11:31 AM

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Apr 05, 2025 am 12:04 AM

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

PHP Program to Count Vowels in a String PHP Program to Count Vowels in a String Feb 07, 2025 pm 12:12 PM

A string is a sequence of characters, including letters, numbers, and symbols. This tutorial will learn how to calculate the number of vowels in a given string in PHP using different methods. The vowels in English are a, e, i, o, u, and they can be uppercase or lowercase. What is a vowel? Vowels are alphabetic characters that represent a specific pronunciation. There are five vowels in English, including uppercase and lowercase: a, e, i, o, u Example 1 Input: String = "Tutorialspoint" Output: 6 explain The vowels in the string "Tutorialspoint" are u, o, i, a, o, i. There are 6 yuan in total

How do you parse and process HTML/XML in PHP? How do you parse and process HTML/XML in PHP? Feb 07, 2025 am 11:57 AM

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

Explain late static binding in PHP (static::). Explain late static binding in PHP (static::). Apr 03, 2025 am 12:04 AM

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.

What are PHP magic methods (__construct, __destruct, __call, __get, __set, etc.) and provide use cases? What are PHP magic methods (__construct, __destruct, __call, __get, __set, etc.) and provide use cases? Apr 03, 2025 am 12:03 AM

What are the magic methods of PHP? PHP's magic methods include: 1.\_\_construct, used to initialize objects; 2.\_\_destruct, used to clean up resources; 3.\_\_call, handle non-existent method calls; 4.\_\_get, implement dynamic attribute access; 5.\_\_set, implement dynamic attribute settings. These methods are automatically called in certain situations, improving code flexibility and efficiency.

See all articles