Forum Moderators: coopster
C:\Program Files\Apache Group\Apache
In the httpd.conf file I changed Port 8080 to Port 8060
Therefore, these lines:
Listen 8060
Servername localhost:8060
The comment from the line above has been removed.
For PHP 5 CGI added:
ScriptAlias /php/ “c:/php/”
AddType application/x-httpd-php .php
Action application/x-httpd-php “/php/php-cgi.exe”
SetEnv PHPRC C:/php
I restarted the computer and then started the Apache server manually.
The error.log looks fine: Starting thread to listen on port 8060
***********
I then manually installed php on my laptop
c:\php
Using the Control Panel
System Icon > Environment Variables > System Variables
I edited the path name and added to the end:
;c:\php;c:\php\ext;
and restarted computer
I then renamed the php.ini-recommended file to php.ini and made the following changes:
browscap = “c:\winnt\system32\inetserv\browscap.ini”
cgi.force_redirect = 0
doc_root=”c:\Program Files\Apache Group\Apache\htdocs”
mysql.default_socket = MySql
mysql.default_host = localhost
extension_dir = “c:\php\ext”
Removed comment from beginning of
extension=php_mysql.dll
I then created hello.php and put in web server’s root directory:
C:\Program Files\Apache Group\Apache\htdocs
Code:
<html>
<head>
<title>PHP Test</title>
</head>
<body>
</php echo ‘<p>Hello World</p>’;?>
</body>
</html>
******************************
In Internet Explorer address window
[localhost:8060...]
I should see the words “Hello World” but I get a blank page.
What do I need to change or add to get PHP to work with the Apache Server?
Robin
[Fri Jan 02 08:10:20 2009] [notice] Apache/2.2.11 (Win32) configured -- resuming normal operations
[Fri Jan 02 08:10:20 2009] [notice] Server built: Dec 10 2008 00:10:06
[Fri Jan 02 08:10:20 2009] [notice] Parent: Created child process 1372
[Fri Jan 02 08:10:20 2009] [notice] Child 1372: Child process is running
[Fri Jan 02 08:10:20 2009] [notice] Child 1372: Acquired the start mutex.
[Fri Jan 02 08:10:20 2009] [notice] Child 1372: Starting 64 worker threads.
[Fri Jan 02 08:10:20 2009] [notice] Child 1372: Starting thread to listen on port 8060.
Robin
I decided to try the module and made the necessary changes in httpd.conf to get Apache 2.2 working with PHP 5. However, I then got this error message:
“Cannot load C:\php\php5apache2.dll into server. The specified module could not be found.”
I searched for these words on the internet and found out that Apache 2.2 didn’t work with PHP 5. The writer said he was going back to Apache 2.0. I decided to do the same and PHP now works. (I'm using the CGI method) Hello.php displays “Hello World”.
Take a look at:
[phpbuilder.com...]
Robin
I searched for these words on the internet and found out that Apache 2.2 didn’t work with PHP 5.
Incorrect. PHP5 works quite well with Apache 2.2 on Windows. The error in your ways here is you are attempting to load the wrong module version in your Apache configuration. When running on 2.2 you need to use the PHP 2.2 Apache module in your conf ...
LoadModule php5_module "c:/php/php5apache2_2.dll"
[php.net...]
Note: Apache 2.2.x Support
Users of Apache 2.2.x may use the documentation below except the appropriate DLL file is named php5apache2_2.dll and it only exists as of PHP 5.2.0. See also » [snaps.php.net...]