How do I check if PHP is installed?
Hi,
I need PHP w/ GD2Lib on my machine. How do I check if PHP is installed and running? How do I start it if it's installed but not running? Also how do I check if GD2Lib is installed? |
Put this in a file on your server:
Code:
<? phpinfo(); ?> |
that will only work if PHP is indded installed AND has been added to Apache...
you could try something as simple as Code:
locate php |
Assuming of course that you have shell access to the server.
And if you did, why not run a command that will give you something useful. The original poster doesn't mention their distro, but if it's rpm based, this'll do it: rpm -qa | grep -i php where locate php on a FC2 box that does NOT have php installed returns 85 entries (not counting /home/(.*)). |
Good point... I assumed there was shell access as he said "my machine"
Then again... depending on the distro... you should be able to check the package managment system to determine if it is installed or not as well... imsam, tell us what distro you are using... |
Thank you all...
Hi,
First, thank you all for your help and responses. I'm actually using Scientic Linux. I do have shell access. When I used the rpm -qa | grep -i php command, I got the info I needed telling me that PHP is installed. I wanted to try locate php just for the heck of it but I got an error telling me that some kind of database is not installed. I can get the exact message if you guys need it. Now, I'm not sure -- as I'm a newbie -- what it means to add PHP to Apache. I also don't know how to do it or check if it is already added. Also the GD2Lib for PHP. How do I check if that's installed? |
The GD2Lib i don't know... never heard of it...
by adding php to apache... (assuming you are using the apache webserver, if not please advise) This means to insert a small string into the apache "httpd.conf" file to load the PHP modules so it can recognize and interperet PHP files... The string is different depending on the installed version of PHP though... |
The locate database being too small is because your cron job hasn't fired yet to make it update (It's a weekly on most systems).
GD2 is a graphics library yes? I don't know of a way to tell if that's in PHP or not short of the <? phpinfo(); ?> posted earlier. To load the module, you need something like this in httpd.conf, assuming it's not there already: Code:
(For 1.3.x) This should appear in your httpd.conf file (or .htaccess in the directory for your php files if nothing else) Code:
AddType application/x-httpd-php .php |
not sure how to carry out php test
Hi,
I have been following this thread (which seems to have been dead for some time)...But I too need to check if php is working. Im not quite sure how to add the phpinfo() script to my server. Is that apache? Im new to Linux-- working on Ubuntu 11.10. Any help on testing php for someone with little experience on linux would be much appreciated lP |
All times are GMT -5. The time now is 02:24 AM. |