LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 10-31-2012, 02:17 AM   #1
dingo-den
Member
 
Registered: Aug 2005
Location: Kamloops, BC Canada
Distribution: Debian 6 and 7
Posts: 30

Rep: Reputation: 0
PHP and HTML


I just installed Centos 6.3 64 bit into a virtual box and I am trying to move my web page and all the scripts over to it.

I have php 5.3.3 installed and after I coppied all the files for the web site to the instance it will not load the index.php. Is there any configuration files that I should have done something to ??


When I run localhost from the browser I just get a blank screen with the name of the site in the top most bar but the page is blank. The html code seems to work but the php does not. The php version that it is running on is 5.1.6,

The code is exactly the same as the code that is running on my web site at http:dingo-den.com but for some reason will not run on the new instance.

Any help would be appresiated and I think I may have many more that I cannot figure out myself with google.

Last edited by dingo-den; 10-31-2012 at 02:53 AM.
 
Old 10-31-2012, 07:22 AM   #2
arun5002
Member
 
Registered: Aug 2011
Location: Chennai,India
Distribution: Redhat,Centos,Ubuntu,Dedian
Posts: 549
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
The html code seems to work but the php does not
Do you enable php5 module to apache

vi /etc /httpd/conf/httpd.conf

LoadModule php5_module modules/libphp5.so

Quote:
I have php 5.3.3 installed and after I coppied all the files for the web site to the instance it will not load the index.php
httpd -M --check whether you had enabled php5 module in apache to load index.php

Last edited by arun5002; 10-31-2012 at 07:23 AM.
 
Old 10-31-2012, 10:20 AM   #3
vishalsamyal
LQ Newbie
 
Registered: Oct 2012
Location: India
Posts: 25
Blog Entries: 3

Rep: Reputation: Disabled
Hello,

Please check If all php modules are installed.If all modules are install then open you apache configuration file. In the same virtual hosting use following syntax:

<VirtualHost *:80>
ServerAdmin administrator@abc.com
DocumentRoot /your/document/root/path/of/your/code
ServerName dingo-den.com
ErrorLog logs/dingo-den.com_error_log
CustomLog logs/dingo-den.com_access_log common
DirectoryIndex index.php
####Following is for directory Listing ###########
<Directory "/your/document/root/path/of/your/code">
Options -Indexes +FollowSymLinks
DirectoryIndex index.php
</Directory>

</VirtualHost>
 
Old 11-01-2012, 01:54 AM   #4
dingo-den
Member
 
Registered: Aug 2005
Location: Kamloops, BC Canada
Distribution: Debian 6 and 7
Posts: 30

Original Poster
Rep: Reputation: 0
Angry

Thanks for the answers and I didn't enable php5 module to apache. I am learning here.

Unfortunately after working on a new VirtualBox of Centos 6 for over 20 hours it got corrupted when we had a power spike and the power went of for a second. When the computer re booted it would not start up the VirtualBox machine.

I will have another go at it tomorrow or the next day and will get back if this works.
 
Old 11-01-2012, 08:06 AM   #5
Turbocapitalist
Member
 
Registered: Apr 2005
Distribution: Ubuntu, Debian, OS X (bsd)
Posts: 144

Rep: Reputation: 27
vm snapshots

Virtualbox can take snapshots, so when you get to a good stopping point in your work take a snapshot. If the power goes bad, you can always roll back to the latest snapshot. Or if you make a mistake you can go back to an earlier version and start over. And you can always delete snapshots you don't need any more. Check the Virtualbox guide for the details, but it is easy.
 
Old 11-01-2012, 10:43 PM   #6
dingo-den
Member
 
Registered: Aug 2005
Location: Kamloops, BC Canada
Distribution: Debian 6 and 7
Posts: 30

Original Poster
Rep: Reputation: 0
Thanks, I will have a look at the snapshots. I will start today loading up a new Centos 6.3 VM.
 
Old 11-03-2012, 03:44 AM   #7
dingo-den
Member
 
Registered: Aug 2005
Location: Kamloops, BC Canada
Distribution: Debian 6 and 7
Posts: 30

Original Poster
Rep: Reputation: 0
OK the PHP works now and I think it was something to do with the server name as PHP was already shared when I did httpd -M.
I ahve marked this thread as solved. I will be opening new threads as I am having problems with other things:

Last edited by dingo-den; 11-03-2012 at 03:46 AM.
 
  


Reply

Tags
apache, html, php5


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
php in html johnh10000 Programming 2 01-25-2010 05:53 AM
PHP without HTML mannclay Programming 6 11-09-2008 01:24 PM
Apache rending php when filename is x.php.html mastahnke Linux - Server 6 01-22-2007 08:39 AM
html into php charnel Programming 7 08-30-2005 10:47 AM
html to php? help me please!!!!! trscookie Programming 4 01-24-2005 06:36 AM


All times are GMT -5. The time now is 03:16 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