Enabling PHP

#1
Could be a newbie question, but I have not found the solution anywhere.

I have a brand new VPS, everything seems to be set up correctly but when I try to use php (either phpinfo() or any echo statement), nothing happens.
I have done a fair amount of reading, I have played with the options in the WHM "Configure Suexec and PHP" screen, but nothing happens.
(I am running Apache 2.x and PHP 5.x).

Did you need to do anything to enable PHP when you got your VPS?

Thanks for your help.
Louis
 

KH-Paul

CTO
Staff member
#2
Louis,

PHP is installed / enabled by default.
What do you see while trying to access php page? Blank screen, error, attempt to download code or something else? If there anything in Apache log file at /usr/local/apache/logs/error_log?

Regards,
Paul
 
#3
Hi Paul,

Nothing between the php tags gets displayed. The HTML before the PHP tags is displayed. The same code runs fine on my local server:
<?php
echo "php is here";
phpinfo();
?>

error_log doesn't show anything when I access that page
error_log shows "PHP/5.2.5 configured" each time I try to tweak php/suexec setup.

I may be doing something stupid but I cannot figure it out.

Louis
 
#6
No, this is just a stupid test file:

toto
<?php
echo "php is here";
phpinfo();
?>
nothing else after this


It prints first and last line, but nothing in between.
Louis
 
#9
All right, this is it. Renaming it did the trick. Thanks a lot!

I thought Apache didn't care: .html, .php or anything.
Is there a configuration somewhere for that?

Louis
 
#11
I read somewhere that you do not have to save your PHP files as .php

This may be correct for stand-alone/CLI php, but not on a web server?

Louis
 
#13
Amen, that's where I got confused.

Also, you can name your php include files whatever you want. That added to my confusion.

Anyway, I'll remember that now!
Thanks,
Louis
 
Top