Hi,
I'm having problems getting php to work on my computer. I've been trying to google the answer for three days now and haven't found an answer. I've tried three or four different installation tutorials and also tried installing on two different computers.
First, I'm running Apache 2.0.52 and PHP 4.3.10 on Windows XP Pro SP2. Apache was pretty straight foward and I can connect to it every time. It's installed to C:\program files\apache group\apache2. When I type localhost into the url bar I get the welcome screen. If I type a page that doesn't exist I get "Not Found".
PHP is installed to C:\PHP. The php.ini file is in C:\windows and I've turned on display_errors and display_startup_errors.
I've added:
ScriptAlias /php/ "C:/php/"
AddType application/x-httpd-php .php .php3
Action application/x-httpd-php /php/php.exe
to httpd.conf, verified that php.ini and httpd.conf is readable by system, added C:\php to my path and set up a system variable named PHPRC with a value of C:\php
As I said, I can view html documents with no problem but when I try to view a php document named phpinfo.php with <?php phpinfo(); ?> in htdocs nothing happens. No change in the browser and I get this in my apache error log:
[Fri Jan 14 19:00:10 2005] [notice] Parent: Created child process 1832
[Fri Jan 14 19:00:10 2005] [notice] Child 1832: Child process is running
[Fri Jan 14 19:00:10 2005] [notice] Child 1832: Acquired the start mutex.
[Fri Jan 14 19:00:10 2005] [notice] Child 1832: Starting 50 worker threads.
[Fri Jan 14 19:23:48 2005] [notice] Parent: Received shutdown signal -- Shutting down the server.
[Fri Jan 14 19:23:48 2005] [notice] Child 1832: Exit event signaled. Child process is ending.
[Fri Jan 14 19:23:49 2005] [notice] Child 1832: Released the start mutex
[Fri Jan 14 19:23:50 2005] [notice] Child 1832: Waiting for 50 worker threads to exit.
[Fri Jan 14 19:23:50 2005] [notice] Child 1832: All worker threads have exited.
[Fri Jan 14 19:23:50 2005] [notice] Child 1832: Child process is exiting
[Fri Jan 14 19:23:50 2005] [notice] Parent: Child process exited successfully.
[Fri Jan 14 19:23:52 2005] [notice] Parent: Created child process 2288
[Fri Jan 14 19:23:52 2005] [notice] Child 2288: Child process is running
[Fri Jan 14 19:23:52 2005] [notice] Child 2288: Acquired the start mutex.
[Fri Jan 14 19:23:52 2005] [notice] Child 2288: Starting 50 worker threads.
and this:
127.0.0.1 - - [14/Jan/2005:07:37:37 -0500] "GET /info.php HTTP/1.1" 404 280
127.0.0.1 - - [14/Jan/2005:07:37:55 -0500] "GET /phpinfo.php HTTP/1.1" 200 32267
127.0.0.1 - - [14/Jan/2005:19:24:01 -0500] "GET / HTTP/1.1" 200 1494
127.0.0.1 - - [14/Jan/2005:19:24:01 -0500] "GET /apache_pb.gif HTTP/1.1" 200 2326
127.0.0.1 - - [14/Jan/2005:19:24:01 -0500] "GET /favicon.ico HTTP/1.1" 200 1078
127.0.0.1 - - [14/Jan/2005:19:24:19 -0500] "GET /phpinfo.php HTTP/1.1" 200 32267
in the access log.
If I put the php script in C:\php and run php.exe from the cmd prompt I will run, so the executable is working. I'm wondering if any particular service should be running on my computer that is shut off, or if there is a bug I'm missing...
Anyhow, I think I've spammed enough for one post. If anyone can help me I would appreciate it. I don't need a production server, I'm just trying to learn php. I'll post my httpd.conf and php.ini if that would help but they are so long I will hold off unless someone wants me to.
Thanks in advance
PHP setup problem
Moderator: General Moderators
I tried what you said but I got the same result, no reaction in the browser.
I think that the lines:
ScriptAlias /php/ "C:/php/"
AddType application/x-httpd-php .php .php3
Action application/x-httpd-php /php/php.exe
that I added in httpd.conf are supposed to refer the script to the interpreter. So if the shebang line is an alternate way of doing that i guess I have less reason to suspect httpd.conf and more reason to suspect php.ini, the possibility that a necessary windows service is not running, or maybe a permission problem with the script, php.ini or the interpreter. I'll look into that some more tonight.
Thanks for the idea and if you have any more, keep them coming
I think that the lines:
ScriptAlias /php/ "C:/php/"
AddType application/x-httpd-php .php .php3
Action application/x-httpd-php /php/php.exe
that I added in httpd.conf are supposed to refer the script to the interpreter. So if the shebang line is an alternate way of doing that i guess I have less reason to suspect httpd.conf and more reason to suspect php.ini, the possibility that a necessary windows service is not running, or maybe a permission problem with the script, php.ini or the interpreter. I'll look into that some more tonight.
Thanks for the idea and if you have any more, keep them coming