Solution to apache + mysql + php server configuration problems

Source: Internet
Author: User
How to solve apache + mysql + php server configuration problems-general Linux technology-Linux technology and application information, the following is a detailed description. Configure Apache + MySql + Php Web server today:/usr/local/apache2/bin/apachectl-k start after the installation and configuration are complete, the following error is reported:
Httpd: Syntax error on line 53 of/usr/local/apache2/conf/httpd. conf: Cannot load/usr/local/apache2/modules/libphp5.so into server:/usr/local/apache2/modules/libphp5.so: cannot restore segment prot after reloc: Permission denied
If the error message "# LoadModule php5_module modules/libphp5.so" is removed, php cannot run because this code loads the php service module. What's going on? This code is automatically generated by the system. Why is there a syntax error? Depressed! So we started to query ....
According to other people's prompts, it turns out that SeLinux is playing tricks. What do I say? How does one crash when an error is reported .... Depressing! What is SeLinux?
Keyword: linux
Security-Enhanced Linux is a new security architecture integrated in the 2.6 core Linux Security modules (LSM). It is a joint project of the National security Agency (NAS) and The SElinux community, through the efforts of NAS and Red Hat companies, seliunx has been integrated into the Red Hat Linux Enterprise Edition Selinux introduction SElinux provides a flexible Mandatory Access Control System (MAC) at the Linux kernel level ), this mandatory access control system is built on the Free Access Control System (DAC.
You know what the above is! In fact, this is quite a firewall... Turn him off!

Problem description: Apache cannot load the plug-in php module, and Apache cannot start automatically after loading the plug-in php module.
Solution: This is caused by improper SELinux security policy configuration. on RedHat's official website, there are related Apache/SELinux policy adjustment documents. If you are in trouble, you can directly repair 1. Change/etc/selinux/config to disable SELinux.
# SELINUX = enforcing
SELINUX = disabled
Change the original enforcing to disabled.
2. chcon-t texrel_shlib_t/usr/local/apache2/modules/libphp5.so
OK
/Usr/local/apache2/bin/apachectl restart

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.