If short_tags is off then you should use e.g
<?php
phpinfo()
?>
You shouldnt need to manually mofify your httpd.conf, by the way. During the PHP install, tell it you have apache (make sure to choose correct version) and point at the %apachedie%/conf folder and it should "just work"
At least it does for me, but i am using Server 2003.
What versions of PHP and Apache are you using
jbennet
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,826
Solved Threads: 601
I have a book and i followed its instructions about the httpd.conf file for apache and I entered those right(according to the book)
Reinstall PHP and let the installer do the configuration for you (there is a step called webserver setup, just choose apache 2.2 and point at the directory where httpd.conf resides). See if that works.
jbennet
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,826
Solved Threads: 601
jbennet
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,826
Solved Threads: 601
Yep, something is wrong then.
Running phinfo() using the CLI parser, should print to the console the same resulting information you would expect to see on the page (e.g platform, modules loaded etc...), not the code itself.
jbennet
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,826
Solved Threads: 601
If php works from the command console but not through the browser then I would say that php is not communicating with the webserver/apache or the php web service has not started up. You might want to check with the command console the command c:\php\php.exe -r 'php_info();' At the top of its output will be hidden errors that may stop the php service from launching. Also, be sure to install apache before php otherwise there might be some configuration problems. And if your using windows, the easiest way the get a web environment setup is by using xampp.
cwarn23
Occupation: Genius
3,033 posts since Sep 2007
Reputation Points: 413
Solved Threads: 259
I ran the command and nothing came up. Also yes i am typing the localhost address in my address bar not the path of the file. And yes i installed apache before i installed php
Opps, silly me placing a bug in that one line of php code. There should be no underline in php_info(); and instead be phpinfo();
Also make sure the path on the left side of the command is the path to your php console/exe file. So try the following if you have installed php in C:\php\
c:\php\php.exe -r 'phpinfo();'
And what to do with that code, place it in the windows command terminal located at start->run->type: cmd ->press enter -> type code described above -> press enter. It should list the data in phpinfo() function to check your configurations.
Also I would suggest to do ctrl+alt+delete to see if php is actually running in the background. But would do a reboot first so results aren't misleading. If the php service is not running in the background then it is likely to be a broken dll (eg. corrupted or incompatible).
cwarn23
Occupation: Genius
3,033 posts since Sep 2007
Reputation Points: 413
Solved Threads: 259
jbennet
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,826
Solved Threads: 601