phpinfo() not working

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kimberly
Forum Commoner
Posts: 31
Joined: Tue Apr 21, 2009 12:48 pm

phpinfo() not working

Post by kimberly »

Hi all,

I had to uninstall PHP5 and install PHP4. Stupid I know, but my code needs to run on PHP4.

Anyhow, my .php file is not working and phpinfo() shows an empty page.
I am using Apache 2.2.11 and I even tried to reinstall that.

I'll really appreciate any help!!

thanks,
Kimberly
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: phpinfo() not working

Post by requinix »

Did you follow all the instructions?
kimberly
Forum Commoner
Posts: 31
Joined: Tue Apr 21, 2009 12:48 pm

Re: phpinfo() not working

Post by kimberly »

:oops:
Thanks for the link.
Do you think the instructions will work for downgrading 5 to 4?

thanks,
Kimberly
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: phpinfo() not working

Post by requinix »

You're uninstalling PHP 5 and installing PHP 4, right? So it's not really a downgrade, just a fresh installation of an older version.
kimberly
Forum Commoner
Posts: 31
Joined: Tue Apr 21, 2009 12:48 pm

Re: phpinfo() not working

Post by kimberly »

Hi!

Thanks for telling me to RTFM LOL!
I've now followed the instructions to the letter.
Apache wouldnt start, so I reinstalled Apache.

When I add these lines as per instructions, Apache still wont start:
LoadModule php4_module "c:/PHP/php4apache2.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:/PHP/"

It did complain during the installation about this: PHPIniDir
If I comment out those lines, Apache starts but ofcourse phpInfo() is still a blank page.

Thanks again for any advice.

regards,
Kimberly
kimberly
Forum Commoner
Posts: 31
Joined: Tue Apr 21, 2009 12:48 pm

Re: phpinfo() not working

Post by kimberly »

httpd.exe: Syntax error on line 488 of C:\Program Files\Apache Group\Apache2.2\conf:
Cannot load C:/PHP/php4apache2.dll into server: The procedure could not be found.
Note the errors or messages above, and press the <ESC> key to exit.

I promise you, the file is there!
:banghead:

Are they supposed to be forward-slashes?

also, I added c:\php into the system path.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: phpinfo() not working

Post by requinix »

Here is a list of server modules shipped with PHP 4 and PHP 5: ...
* sapi/php4apache2.dll (php5apache2.dll) - Apache 2.0.x module.
* sapi/php5apache2_2.dll - Apache 2.2.x module.
Make sure you're using the right file.
kimberly
Forum Commoner
Posts: 31
Joined: Tue Apr 21, 2009 12:48 pm

Re: phpinfo() not working

Post by kimberly »

and for Apache 2.2.x with PHP4?
The doc says php4apache2.dll which I copied from the sapi directory into c:\php
But it doesnt find it.
kimberly
Forum Commoner
Posts: 31
Joined: Tue Apr 21, 2009 12:48 pm

Re: phpinfo() not working

Post by kimberly »

Hi,

I still cant get Apache to start with the load module.

If I used the suggested CGI lines in httpd.conf:
ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php
# For PHP 4
Action application/x-httpd-php "/php/php.exe"

Then Apache will start but when I try to access the page with my phpInfo() in it, I get this:
You don't have permission to access /php/php.exe/hello.php on this server.

Please help?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: phpinfo() not working

Post by requinix »

kimberly wrote:and for Apache 2.2.x with PHP4?
The doc says php4apache2.dll which I copied from the sapi directory into c:\php
But it doesnt find it.
No, it doesn't say that.

Read this again.
Here is a list of server modules shipped with PHP 4 and PHP 5: ...
* sapi/php4apache2.dll (php5apache2.dll) - Apache 2.0.x module.
* sapi/php5apache2_2.dll - Apache 2.2.x module.
There's no mention of PHP 4 and Apache 2.2. Which is good, because PHP 4 is too old and they've been telling us to upgrade for a few years now.

Unless you need something that only CGI-mode offers, go with the module version.
kimberly
Forum Commoner
Posts: 31
Joined: Tue Apr 21, 2009 12:48 pm

Re: phpinfo() not working

Post by kimberly »

Are you saying that Apache 2.2 wont work with PHP4??

Now I need to downgrade Apache???!

I need PHP4 to match the server the code will be running on.

thanks again for the replies.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: phpinfo() not working

Post by requinix »

kimberly wrote:Are you saying that Apache 2.2 wont work with PHP4??
Correct.
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 http://snaps.php.net/
kimberly
Forum Commoner
Posts: 31
Joined: Tue Apr 21, 2009 12:48 pm

Re: phpinfo() not working

Post by kimberly »

thanks for your replies
kimberly
Forum Commoner
Posts: 31
Joined: Tue Apr 21, 2009 12:48 pm

Re: phpinfo() not working

Post by kimberly »

I've just installed Apache 2.0.58 and I have the same result.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: phpinfo() not working

Post by requinix »

- Are you using PHP as a CGI program or as a module?
- What error messages are you getting?
- And post the httpd.conf and any .htaccess stuff you used to configure PHP.
Post Reply