Apache cannot resolve php problems

Source: Internet
Author: User
Tags apache php php mysql vc9
Apache has been unable to resolve the php issue for three or four days and is about to go crazy. the little girl is here to ask you how to configure
The following is the configuration file I modified. The php directory is C: \ php, and the php INI file has been changed.

Apache has also been modified
LoadModule php5_module "C:/php/php5apache2_2.dll"


DirectoryIndex index. php index.html



AddType application/x-httpd-php. php. phtml
AddType application/x-httpd-php-source. phps
PHPIniDir "C:/php"


Reply to discussion (solution)

View:
Computer> Properties> Advanced> environment variables,
Is there a PHP program path?

C: \ php; C: \ php \ ext has been added to the environment variable.

It is easy to install with an installation kit. For example, xampp.

It's hard to figure out that apache can run. I want to figure it out. I'm afraid that a few things are a bunch of problems. By the way, I built it on win7.

Check whether the file C:/php/php5apache2_2.dll exists.

This file exists

Httpd. conf file modification content:

AddType application/x-httpd-php. php
...

DirectoryIndex index. php index.html

...
# Begin php installer edits-REMOVE ONLY ON UNINSTALL
PHPIniDir "C:/Apache"
LoadModule php5_module "C:/Apache/php5apache2_2.dll"
# End php installer edits-REMOVE ONLY ON UNINSTALL

I have no AddType application/x-httpd-php-source. phps line here.
Can you comment out and try again?

You must restart the service.

Isn't that enough? What's the problem?

Uninstall the original apache and delete the original directory. Then install apache under the http://windows.php.net/downloads/releases/archives/php-5.3.5-Win32-VC6-x86.msi to install this php automatically write configuration information to config all Tiancheng.

Check the mime. types file and search for "php ".
Application/x-httpd-php
Application/x-httpd-php-source phps
These two rows.

No
Application/x-httpd-php
Application/x-httpd-php-source phps

Is it added?

If no, add it.

If you can reinstall it, the method on the 10th floor is the most convenient.

It's useless if I make it up.

Open event viewer-> application to see what error it reports.
Desktop-> Computer-> Management-> System Tools-> Event Viewer-> Applications.

Apache HTTP Server 2.2.22
Win32 Binary without crypto (no mod_ssl) (MSI Installer): httpd-2.2.22-win32-x86-no_ssl.msi
Http://mirror.bjtu.edu.cn/apache//httpd/binaries/win32/httpd-2.2.22-win32-x86-no_ssl.msi
+
PHP 5.2 (5.2.17)
VC6 x86 Thread Safe (2011-Mar-22 13:29:30)
Http://windows.php.net/downloads/releases/php-5.2.17-Win32-VC6-x86.msi
Set up successfully.


Only two places have been changed,
Homepage settings:

DirectoryIndex index. php index.html

...
PHP loading at the end of the file:
PHPIniDir "C:/Apache"
LoadModule php5_module "C:/Apache/php/php5apache2_2.dll"

Install Apache in: C:/Apache
PHP is installed in: C:/Apache/PHP
Add the following system environment variables: C: \ Apache \; C: \ Apache \ PHP \;...

Application/x-httpd-php-source phps

This is only used to parse phps, and it does not matter.
The key is loadmodule.

Sorry, this problem cannot be debugged. It's like two people haven't taken their heads up yet, let alone completed the task.
The only method is to try again and try to make it different from the previous one. Search for "apache php mysql" on the internet and find out if you have any missing steps.

I compromised the installation of an appserver. I think it may be a problem with my operating system.

Next File comparison tool (such as BeyondCompare and UltraCompare ),
Compare the AppServ directory with your apache and php Directory,
Now we can find the difference.

In addition, I provide a non-installation-free green server, just hitting the package,
In my resources:
Http://download.csdn.net/detail/guilyn/4214864
Try Win7 for good use ,:)

Give guilyn all the points.

By the way, I set it up in win7.
A new Win7 is installed after the festival, and the same problem occurs.
After a few minutes of being depressed, I suddenly thought of a VC9 version,
Php-5.3.10-Win32-VC9-x86.msi
Http://windows.php.net/download/
The problem was fixed after the reinstallation.

Official notes:

Which version do I choose?If you are using PHP with Apache 1 or Apache2 from apache.org you need to use the VC6 versions of PHPIf you are using PHP with IIS you should use the VC9 versions of PHPVC6 Versions are compiled with the legacy Visual Studio 6 compilerVC9 Versions are compiled with the Visual Studio 2008 compiler and have improvements in performance and stability. The VC9 versions require you to have the Microsoft 2008 C++ Runtime (x86) or the Microsoft 2008 C++ Runtime (x64) installedDo NOT use VC9 version with apache.org binariesVC9 versions of Apache can be fetched at Apache Lounge. We use their binaries to build the Apache SAPIs.

This is also the version I installed on XP. this problem also occurs for a long time. I checked many articles, including the author's article. It is still puzzling. Later I thought that since someone could configure it, it was probably a problem with my system. If other programs run well, the system problems alone are not the same. The most likely problem is the installation problem between apache and php. It is finally solved today. The key to the problem is that if you have installed the php msi (that is, the install version), you must first uninstall it, and then decompress it with the zip version to modify httpd. conf file. the modification method is described in Guilyn 18 # above. If it is not clean after uninstallation, search the registry to delete php (the installed version will write information in the registry and so on ). If PHP is a ZIP version and you need to set system variables, you can set the environment variables as described on the second floor. change the directory to your PHP installation directory.

Although this information is far away from the past, some friends may still use this configuration to install wamp for reference. Celebrate by yourself! :)

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.