How to setup gateway Centos 6 commandline

If you’ve just finished setting up your Centos and completed the network configuration from my previous post. You are probably wondering why your internet is down again after you have restarted your VM. Reason is, you probably haven’t setup any gateway yet. To set the gateway you need to open and edit the file with your favorite editor, in my case “vim” editor.

vi /etc/sysconfig/network

add the line


then issue an

/etc/init.d/network restart

make sure you are root user.

New VM – Centos no internet?

So you have finally completed setting up your first vm and installed Centos 6 (minimal version) but having problem with internet connection?

We’ll you might hit the same issue as mine. not to worry as you just need to do extra configuration for the network.


1. Open this file with your favorite editor for my case im using vim editor

vi /etc/sysconfig/network-scripts/ifcfg-eth0

2. Change the values




Note: some distribution has quote, just follow the quote if yours got.

3. Save and exit the editor

4. restart the network service

/etc/init.d/network restart

5. ping any website and see if internet works.


include_path not working – php centos

Have you been banging your head on the wall for days, trying to figure out why your include_path in php.ini is not workin? and you have tried …

1. restarting your apache/nginx
2. and verified that you are editing correct file
3. and doubled check the phpinfo() and include path is correctly set
4. and tried checking the get_include_path() whether it’s including it at run time?

Well there’s one more thing you haven’t done!

late that i know that this is not a PHP nor apache/nginx issue.

happenss to be an OS issue! for my case im using Centos 6 and i happen to discover from a friend that Centos ships with SELinux. what’s SELinux?? check out here for the explanation =>

You have to disable the SELinux for apache to be able to work outside the public path!

Give it a try!