Build PHP Runtime Environment

Source: Internet
Author: User
Tags gettext php source code

Build PHP running environment in the premise of building PHP to build the Apache,mysql to complete. Install PHP package (manually compiled installation) 1: Install GD Library and GD Library affiliate Program//to process and generate pictures//
[[email protected] lamp]# yum install > libjpeg-devel > libpng-devel > freetype-devel > zlib-devel > gettext-devel > libXpm-devel > libxml2-devel > fontconfig-devel > openssl-devel > bzip2-devel -y
2: Unzip the GD library and compile
[[email protected] lamp] tar zxvf /opt/lamp/gd-2.0.35.tar.gz -C /opt/[[email protected] lamp] cd ../gd/2.0.35/[[email protected] 2.0.35] ./configure --prefix=/usr/local/gd[[email protected] 2.0.35] make && make install
3: Unzip the PHP source code package and install the compilation
[[email protected] php-5.5.38] tar zxvf /opt/lamp/php-5.5.38.tar.gz -C /opt/[[email protected] php-5.5.38] ./configure > --prefix=/usr/local/php > --with-apxs2=/usr/local/httpd/bin/apxs > --with-gd > --with-mysql=/usr/local/mysql > --with-config-file-path=/etc > --enable-sqlite-utf8 > --with-zlib-dir > --with-libxml-dir > --with-freetype-dir > --with-jpeg-dir > --with-png-dir > --with-ttf > --with-iconv > --with-openssl > --with-gettext > --enable-mbstring > --enable-gd-native-ttf > --enable-gd-jis-conv > --enable-static > --enable-zend-multibyte > --enable-inline-optimization > --enable-sockets > --enable-soap > --enable-ftp > --disable-ipv6[[email protected] php-5.5.38] make && make install
4: Let Apache support PHP
#找到 AddType application/x-gzip .gz .tgz 在下面添加如下内容[[email protected] ~] vim /usr/local/apache/conf/httpd.conf    AddType application/x-httpd-php .php    AddType application/x-httpd-php-source .phps# 搜索php5有没有下面这个配置    LoadModule php5_module        modules/libphp5.so# 找到这个标签在index.html后面加入index.php<IfModule dir_module>      DirectoryIndex index.html index.php</IfModule>
Restarting the HTTPD service
[[email protected] ~] systemctl restart httpd.service
Join the PHP test page
[[email protected] ~] cd /usr/local/httpd/htdocs/[[email protected] htdocs] lsindex.html[[email protected] htdocs] vim index.html 
PHP is built after the Apache Web page optimization, you can first try to build a forum next blog will talk about building a simple forum below open the Web test

If you have no access to see if the firewall is off

Build PHP Runtime Environment

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.