This article mainly shares with you how to restart apache and check the php environment under Linux. This article mainly shares with you the code. I hope it can help you.
First switch to the init.d directory
cd /etc/rc.d/init.d
Then ls lists the directory:
Use httpd -v Check the installed httpd version,
Use rpm -qa | grep httpd to check whether httpd is installed
Use ps -ef | grep httpd to view the httpd process
Use service httpd status to view the running status of httpd
Use service httpd stop to stop httpd
Use service httpd start to start httpd
service After the httpd service is started, you can enter http://localhost in the browser to browse and test. If you can see the page shown below, it means that Apache can normal work.
If apache is installed as a Linux service, you can use the following command:
service httpd start start
service httpd restart restart
service httpd stop Stop the service
Related recommendations:
Examples of how to set up compression and caching for Apache in Linux
php and apache Detailed explanation of relationships and functions
The above is the detailed content of Restart apache under linux and check the php environment. For more information, please follow other related articles on the PHP Chinese website!