LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   PHP and HTML (http://www.linuxquestions.org/questions/linux-software-2/php-and-html-4175434854/)

dingo-den 10-31-2012 02:17 AM

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.

arun5002 10-31-2012 07:22 AM

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

vishalsamyal 10-31-2012 10:20 AM

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>

dingo-den 11-01-2012 01:54 AM

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.

Turbocapitalist 11-01-2012 08:06 AM

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.

dingo-den 11-01-2012 10:43 PM

Thanks, I will have a look at the snapshots. I will start today loading up a new Centos 6.3 VM.

dingo-den 11-03-2012 03:44 AM

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:


All times are GMT -5. The time now is 07:31 PM.