Jump to content

Help - My php can be ran from the command prompt, but not from windows.


Recommended Posts

I am a newbie to PHP, and am attempting to learn. On my XP  computer I can get everything to run correctly.  My Vista machine I can get the following working.

 

I can run my php programs from command prompt using c:\php\programname.php

 

I can run http://localhost/ and Apache comes up fine.

 

MySQL can be run frm the command prompt also.

 

What do I need to look for to solve my problem of running PHP in my editor, or from Apache?  I get either error 404 or 403

 

 

Thanks, for your Help.

Mike

I changed the httpd.conf and added:

 

Include Apache2.2/conf/httpd-php5.conf

Include conf/extra/httpd-ssl.conf

 

and then made a new file:

webserver/Apache2.2/conf/httpd-php5.txt

 

The new file contains the code:

LoadModule php5_module "C:/php/php5apache2_2.dll"

LoadModule php5_module "C:/webserver/Apache2.2/php5apache2_2.dll"

PHPIniDir "C:/php"

 

AddType application/x-httpd-php .php

 

 

I restarted Apache.  Now when I ask it to run test.php

which contains:  <?php

                                phpinfo();

                        ?>

 

I no longer get error messages, however all Apache did was print the code in test.php

 

Any sugestions?

Thanks, in advance.

Mike

 

 

Why are you loading two PHP modules of the same version:

LoadModule php5_module "C:/php/php5apache2_2.dll"
LoadModule php5_module "C:/webserver/Apache2.2/php5apache2_2.dll"

 

You only need one. Preferably the first line:

LoadModule php5_module "C:/php/php5apache2_2.dll"

I had placed the library in both areas not knowing where my problem was.

 

It still runs the same with no changes.

Php runs from the command line and not through windows.

 

Any other sugestions?

 

Thanks..  Mike

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.