PHP installation strategy: frequently asked Questions

Source: Internet
Author: User
Tags install php php and php script
One
Q: I have installed the UNIX version of the Apache module by step, but my php script source is displayed in the browser, or the browser prompts me to save the file. Why?
A: This is because the PHP module is not working properly. Please check the following three places:
Make sure that the Apache execution file you are running is the one you succeeded in compiling the final compilation. Enter the following command:
/path/to/binary/httpd-l
If you don't see mod_php3.c in the list, then you don't run a correct execution file.
 
Make sure you have added the correct Mime Type in one of your. conf. This should look like this:
AddType application/x-httpd-php3. php3
Make sure the "AddType" above is not in or out of the block, otherwise this addtype will only take effect in the current VirtualHost or directory.
 

Two
Q: I have followed the instructions to install PHP, but my PHP still can't work with IIS, why?
A: You must make sure that the user running PHP has sufficient privileges to run Php.exe. The IIS server uses an anonymous account that is created at installation time, and this account needs to run Php.exe permissions. In addition, any user who has to be proven has the right to run Php.exe.

Three
Q: How do I compile php with Apache 1.3.X?
A: This is simple, just follow the steps below:
-Get the latest Apache distribution from the Apache site
-Unzip/untar files to a directory, such as/usr/local/src/apache-1.3.9
-Enter "./configure--with-apache=/path/to/your/apache" to start compiling PHP for the first time
-Execute "make" sequentially, "make install", create and copy the necessary files into the Apache directory
-Enter the Apache directory to edit the configuration file. At the end of the file, add: "Addmodule modules/php3/libphp3.a"
Execute "./configure", "make"
All done, you've got an Apache executable file that runs PHP.
Four
Q: When I compile PHP and Apache together, there seems to be a problem. It always says that the Httpd.h file cannot be found, but in fact the file exists. Why?
A: You need to let the PHP configuration/installation script know your Apache source's top-level directory, not the directory containing the Httpd.h file. In other words, you should specify "--with-apache=/path/to/apache/" instead of "--with-apache=/path/to/apache/src".
 

Five
Q: I installed PHP using RPM, but Apache can't process php files. Why?
A: Assuming you use RPM to properly install PHP, you must either reverse or add the following lines to the httpd.conf file:
#Extra Modules
Addmodule mod_php.c
Addmodule mod_php3.c

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.