LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-09-2013, 04:16 PM   #1
Bruce Whealton
LQ Newbie
 
Registered: Feb 2013
Posts: 1

Rep: Reputation: Disabled
Problems getting php to work with Centos Linux and Apache


Hello all,
I have Centos running on a separate machine in my local network. I wanted to learn skills that would help me manage a dedicated hosting account, so I setup dynamic dns services. I haven't gotten to the chapter I am reading in various books that deal with DNS on my Centos machine. It is version 6.3 of Centos.
So, I have fwwebdev.dnsdynamic.com available in the directory /home/www, with full path
/home/www/fwwebdev.dnsdynamic.com/
I have a public_html folder in there but I haven't figured out how to get the root for each domain to serve files from the public_html directory instead of from the directory for that domain. I also probably want to setup username's for each directory, so if I wanted to host futurewavehosting.com, with username fwhost, I would have a folder /home/www/fwhost/
and inside there I'd have public_html and that's where the public area for my site would be. That's how it is on my dedicated server that was setup by a company.
When I browse to http://fwwebdev.dnsdynamic.com I get the index.php file that I put inside /home/www/fwwebdev.dnsdynamic.com/
When I view the source code, I just see my html without any php generated code. It is just thrown out.
I did install php as root using
yum install php*
when I tried that again, it said everything is installed and up to date. I did a search
yum search php and tried installing various packages and they were reported as already installed.
I don't have php anywhere in the /etc/httpd/conf/httpd.conf file. But I have a call to
Include conf.d/*.conf
and there is a simple short file there which I'll copy below. It seems that the other php modules should be called by the httpd.conf file or by the php.conf file. From what I read, it seems that these files should be added to the httpd.conf file when I run the
yum install php*

Here's a thought... I installed the php files from the Centos desktop. So, when I run yum install php* it reports nothing to install and that might be why nothing gets added to the httpd.conf file. It's just a hunch. Guess I'd need to uninstall and then reinstall php to check that out.
Any other thoughts?

Thanks,
Bruce
 
Old 03-09-2013, 06:46 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,241

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
You might want to reference this http://www.linuxtopia.org/online_boo..._6_deployment/ & there's a whole set of manuals on that site.
All free to read

I suspect you haven't enabled cgi (ie dynamic code like php) in the httpd.conf.
For safety, cgi scripts are disabled in the install.
This could cause the script to be displayed as a 'page', like html, but the browser doesn't understand php, so it dumps it as text.
HTH

Last edited by chrism01; 03-09-2013 at 06:48 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
[SOLVED] problems with lamp (linux apache mysql php kuser:) Linux - General 2 02-27-2012 04:35 AM
Centos 5.2 running Apache 2 and PHP 4 cannot display info.php codenjanod Linux - Server 2 08-19-2008 03:00 AM
Centos 5, Apache, php, mysql Anauj0101 Linux - Server 5 02-26-2008 11:39 PM
Can't get PHP 5 to work on CentOS 4.2, Apache 2.0.52 tibberous Linux - Server 3 10-27-2007 07:25 AM
problems with the apache & Php server of mandrake linux 9.1 krotaz Linux - Networking 6 11-21-2003 09:24 PM


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

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration