Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I get all my php files run on a Linux server? I copied all PHP files to my Linux server under /www and I did change config settings like the following. Also I created an error log file under /logs.

But when I run in browser, it is not working and the page shows:

Oops! Google Chrome could not find

I think I need to change or add something.

I use Putty to access the Centos and use WinSCP as FTP.

<VirtualHost *:80>
DocumentRoot /www/allphpfile/
ErrorLog logs/my_test_error_log
share|improve this question
did you tried putting a phpinfo file? added php modules in http.conf? are you getting the default apache web page? – Renju Chandran chingath Jul 19 '13 at 5:23
Do nslookup in command line. Does that show your IP address? Do you have a DNS server set up for that (I don't think you're the owner of domain, right)? lol – Ashtray Jul 19 '13 at 6:24
Also make sure your files are in /var/www and not /www – there's no reason to put them into a folder at the root level of your file system. – slhck Jul 19 '13 at 6:29
@slhck Actually, these days something like /srv/www might be a more appropriate place. – Michael Kjörling Jul 19 '13 at 12:56
@MichaelKjörling True, good to know, but if the OP is using a default LAMP install, I guess /var/www should do. – slhck Jul 19 '13 at 12:57

You can not connect to a service under unless you are the owner of that domain. You need three things to host PHP content;

  1. PHP enabled web server (e.g Apache).
  2. PHP modules for that server.
  3. A computer (or VM) with a public IP address.

Technically speaking, you don't need any of that to "run a PHP file". You can install the interpreter using the package manager and invoke it on a file:

php /home/moo/somescript.php

Another user suggested that it is actually possible to use the example domain if it is configured locally. To enable the local machine to resolve an arbitrary domain, you can associate that arbitrary domain with an arbitrary IP address in /etc/hosts like so:


 # local        monger.lan      mon.lan monger   mon   ruter        tryggve.lan     try.lan tryggve  try
 # remote
 xx.zz.yy.185  caracal
 xx.zz.yy.184  gaupe
 xx.zz.yy.175 pvv
 # example

(xx.zz.yy must be actual numbers)

share|improve this answer

Solution: configure LAMP server in centos followed by few step, reference url for configuration and also install phpmyadmin for database management refrence url

share|improve this answer
Instead of just posting links to complete LAMP configuration tutorials, you should attempt to address the specific issue the OP has, namely not being able to connect to – for obvious reasons. – slhck Jul 19 '13 at 6:20
  1. Install php package through rpm or yum.

  2. Then first we need to know what kind of hosting user require(dedicated hosting or virtual hosting)

  3. Install mysql package on server

  4. make changes in httpd>conf>httpd.conf file if you wants to get any change regarding the apache service port No and all that

  5. To provide the virtual hosting through a single service & singla IP. Kindly refer below DocumentRoot /var/www/.html ServerName

  6. start httpd service service httpd start

  7. Now try to host any of website by providing the ip of apache installed system at DNS for or rev files.

  8. Enjoy the day

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.