LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 06-18-2012, 12:51 AM   #1
saxophonemaster
LQ Newbie
 
Registered: Jan 2011
Posts: 5

Rep: Reputation: 0
PHP installed but not executing when in browser on CentOS server


I have installed php on my centos browser, but now it appears that it is not working. (I don't know at what point it no longer worked). I created a page called phpTest.php with just a phpinfo() script and it produces a blank page. Is there something within my httpd.conf file I need to add or should I try reinstalling php? (If I should try reinstalling - how do I uninstall it first).

Thanks,
Travis
 
Old 06-18-2012, 01:10 AM   #2
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-{14.1,current} on a Lenovo Thinkpad T61 6457-4XG
Posts: 4,386

Rep: Reputation: 1089Reputation: 1089Reputation: 1089Reputation: 1089Reputation: 1089Reputation: 1089Reputation: 1089Reputation: 1089
To check that php be properly installed, please post output of following command typed in a terminal:
Code:
which php
Also, check that your configuration files are properly set up, mainly:
/etc/httpd/modf_php.conf
/etc/httpd/php.ini
/etc/httpd/httpd.conf

Especially, in /etc/httpd/httpd.conf following line should not be commented:
Code:
Include /etc/httpd/mod_php.conf
 
Old 06-18-2012, 10:57 PM   #3
saxophonemaster
LQ Newbie
 
Registered: Jan 2011
Posts: 5

Original Poster
Rep: Reputation: 0
So the result of which php is
Code:
/usr/bin/php
So I don't see a mod_php.conf, but I do see a php.conf in /etc/httpd/conf.d/php.conf
The php.ini file is at /etc/php.ini
And the httpd file is at /etc/httpd/conf/httpd.conf

There is a line in the httpd file that says:
Code:
Include conf.d/*.conf
which should include the right files, right?

---------- Post added 06-18-12 at 10:58 PM ----------

Also the server root is /etc/httpd
 
Old 06-19-2012, 12:43 AM   #4
routers
Member
 
Registered: Aug 2005
Location: Malaysia - KULMY / CNXTH
Distribution: Slackware, Fedora, FreeBSD, Sun O/S 5.10, CentOS
Posts: 771
Blog Entries: 6

Rep: Reputation: 75
before .php is that any .html work in the browser?
if not then you need to look at chmod things

otherwise paste VirtualHost container
 
Old 06-20-2012, 08:55 PM   #5
saxophonemaster
LQ Newbie
 
Registered: Jan 2011
Posts: 5

Original Poster
Rep: Reputation: 0
Yeah, I can access html pages and they load fine. Just php pages won't load.

So the virtual host container is commented out, but is:
Code:
#<VirtualHost *:80>
#    ServerAdmin webmaster@dummy-host.example.com
#    DocumentRoot /www/docs/dummy-host.example.com
#    ServerName dummy-host.example.com
#    ErrorLog logs/dummy-host.example.com-error_log
#    CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>
However the following is through the httpd.conf
Code:
ServerRoot "/etc/httpd"
Include conf.d/*.conf
ServerAdmin root@localhost
DocumentRoot "/var/www/html"
DirectoryIndex index.html index.html.var default.htm index.php
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
Anything that might be missing?
 
Old 06-20-2012, 11:45 PM   #6
routers
Member
 
Registered: Aug 2005
Location: Malaysia - KULMY / CNXTH
Distribution: Slackware, Fedora, FreeBSD, Sun O/S 5.10, CentOS
Posts: 771
Blog Entries: 6

Rep: Reputation: 75
ok looks good for this, and follow this command below

Code:
# cd /var/www/html
# echo '<? phpinfo (); ?>' > info.php
# apachectl restart

and point your browser to http://your.ip/info.php

see what happen
 
Old 06-20-2012, 11:53 PM   #7
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,104

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
posting a copy of your httpd.conf might help

Last edited by frieza; 06-20-2012 at 11:57 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in executing php code in lamp server under open suse 11.3 sisirkumar Linux - Newbie 2 09-14-2011 02:11 PM
problem in executing php code in lamp server under open suse 11.3 sisirkumar Linux - Newbie 1 09-14-2011 09:48 AM
Installed CentOS Directory Server...what now? custangro Linux - General 19 12-04-2009 04:38 PM
Anyone successfully installed gphpedit (PHP Editor) on CentOS? rsleventhal Linux - Software 3 06-03-2008 07:09 AM


All times are GMT -5. The time now is 09:40 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration