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

Link to comment
Share on other sites

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

 

 

Link to comment
Share on other sites

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"

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.