Article Title: FedoraLinux + Apache + MySQL + PHP installation configuration. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
1. download the new MySql_server.rpm
Rpm-ivh Mysql_server_XXXX.rpm install server Platform
Rpm-ivh Mysql_client_xxxx.rpm install the client package
If you are updating and installing, you may prompt confict, so replace rpm-ivh is rpm
-Uvh
2. install apache
Tar-zxvf httpd-2.2.6.tar.gz
Cd httpd-2.2.6
. /Configure -- prefix =/usr/local/apache -- enable-module = so
Make
Make install
3. Install php-5.2.4
Tar-zxvf php-5.2.4.tar.gz
Cd php-5.2.4
. /Configure -- prefix =/usr/local/php -- with-apxs2 =/usr/local/apache2/bin/apxs
-- With-config-file-path =/usr/local/lib -- with-mysql
Make
Make install
Cp php. ini-dist/usr/local/lib/php. ini
4. Configuration
Vi/usr/local/apache/conf/httpd. conf configure apache as follows:
# Change the ServerAdmin line to your email address
# DocumentRoot "/home/httpd/html/" is the main directory of the html file.
# Options FollowSymLinks MultiViews for security reasons, remove "Indexes"
# DirectoryIndex default. php default. phtml default. php3 default.html
Default.htm
#
# Set the default file name order of apache
# AddType application/x-httpd-php. php. phtml. php3. inc
# AddType application/x-httpd-php-source. phps
# Set the php file suffix
Save disk and exit
Vi/usr/local/lib/php. ini
# Register-golbals = On
Save disk and exit
5. Start apache
/Usr/local/apache2/bin/apachectl start
If an error is prompted:
Can not load/usr/local/apache2/modules/libphp5.so into server:
/Usr/local/apache2/modules/libphp5.so:
Can't restore segment prot after reloc: Permission denied
Linux
Because the php module cannot be loaded, when debugging the PHP program, the system prompts you to download php or display the php source.
Code, solution:
Modify httpd. conf
LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php. php
Run: chcon/usr/local/apache2/modules/libphp5.so-t shlib_t
Log out of the system and enter again
/Usr/local/apache2/bin/apachectl start