PHP installation tips: linux 2 _ PHP Tutorial

Source: Internet
Author: User
PHP Installation Guide linux 2. B 4. how to install and configure the RPM Package is bundled with apache, php3, and MySQL in many Linux releases. since MySQL is distributed in RPM format, therefore, it has been installed above B> 4. how to install and configure from the RPM Package
Apache, php3, and MySQL are bundled in many Linux releases. since MySQL is distributed in RPM format, the installation has been described above, the following describes only the installation and configuration of apache and php. This article is based on RedHat Linux 6.1. PHP designers do not recommend configuring php3 from RPM, but it will solve this problem in php4. Since re-configuring from RPM and installing php are troublesome, the following methods are for reference only.
1. the rpm file you need
To reconfigure and compile php, you should download the source code rpm of php3: php-3.0.12.6.src.rpm. This package generates the following rpm:
Php-3.0.12-6.i386.rpm php-manual-3.0.12-6.i386.rpm
Php-imap-3.0.12-6.i386.rpm php-ldap-3.0.12-6.i386.rpm
Php-pgsql-3.0.12-6.i386.rpm
Before installing the new rpm, you should first delete the php software package:
Rpm-e php-imap php-ldap php-pgsql php-manual
The following software packages are required to re-compile php:
Apache-devel
Postgresql-devel
MySQL-devel
2. reconfigure, compile, and install php3
Install the php3 source code package:
Rpm-I php-3.0.12-6.src.rpm
It installs the php source code in the/usr/src/redhat Directory, enters the directory, and configures and compiles the following command:
Cd/usr/src/redhat/SPECS
Vi php. spec
Edit the php. spec file, find the % build section, and add the following to the./configure options section:
With-mysql =/usr

It indicates that php supports the MySQL database.
% Build
Cd imap-4.5
Make RPM_OPT_FLAGS = "$ RPM_OPT_FLAGS" lnp
Cd ..
Autoconf
CFLAGS = "-fPIC"./configure -- prefix =/usr
With-apxs =/usr/sbin/apxs
With-config-file-path =/etc/httpd
Enable-safe-mode
With-exec-dir =/usr/bin
With-system-regex
Disable-debug
With-zlib
Enable-debugger
Enable-magic-quotes
With-mysql =/usr
Enable-track-vars
Save the changes and recreate the rpm Package:
Rpm-bb/usr/src/redhat/SPECS/php. spec
Finally, find the corresponding binary rpm packages in the/usr/src/redhat/RPMS/i386 directory and reinstall them:
Rpm-I/usr/src/redhat/RPMS/i386 /*
3. configure httpd. conf and srm. conf.
After installing php, you should configure httpd to support php3 scripts. First, edit/etc/httpd/conf/httpd. conf, find the following two lines, and remove the annotator #:
AddModule mod_php3.c
LoadModule php3_module modules/libphp3.so
After compiling/etc/httpd/conf/srm. conf, remove the annotator # In the following line #:
AddType application/x-httpd-php3. php3
In this way, httpd treats files ending with. php3 as php script files.
4. test
You can use the above two examples for testing.
5. Summary
Although some Linux publishers such as RedHat bundle the above three software packages in their distribution, php's rpm Package initially does not support MySQL databases. In addition, the usage of mod_php3 or mod_php is outdated, and the new format is libphp3.so. Therefore, mod_php3 or mod_php is not included in the binary distribution of RedHat.
If you want to keep using the latest versions of the three software, the first two methods are the most suitable.
The above only introduces the installation of these three software, you must configure the security settings of php and MySQL.

Http://www.bkjia.com/PHPjc/509172.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/509172.htmlTechArticleb> 4. how to install and configure from RPM Package in many Linux releases are bundled with apache, php3 and MySQL, because MySQL itself is distributed in RPM format, so it has been installed above...

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.