您好,登錄后才能下訂單哦!
1、創建用戶
/usr/sbin/groupadd www
/usr/sbin/useradd -r www -g www
2、安裝依賴包
apt-get install -y make gcc g++ curl libxml2 libxml2-dev libssl-dev libcurl4-openssl-dev libjpeg-dev libpng12-dev bzip2 libbz2-dev libxpm-dev libfreetype6-dev libedit-dev libxslt-dev
tar zxvf libmcrypt-2.5.8.tar.gz -C /home/tbt/src/
cd /home/tbt/src/libmcrypt-2.5.8/
/sbin/ldconfig
cd libltdl/
./configure --enable-ltdl-install
make && make install
cd ..
./configure
make && make install
tar zxvf libiconv-1.14.tar.gz -C /home/tbt/src/
cd /home/tbt/src/libiconv-1.14
sed -i -e '/gets is a security/d' ./srclib/stdio.in.h
./configure --prefix=/usr/local
make && make install
3、編譯安裝php
tar zxvf php-5.5.14.tar.gz -C /home/tbt/src/
cd /home/tbt/src/php-5.5.14
./configure --prefix=/home/tbt/php \
--with-mysql=/home/tbt/mysql \
--with-mysqli=/home/tbt/mysql/bin/mysql_config \
--with-pdo-mysql=/home/tbt/mysql \
--enable-fpm \
--with-fpm-user=www \
--with-fpm-group=www \
--with-curl \
--with-pear \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-zlib \
--with-xpm-dir \
--with-freetype-dir \
--with-mcrypt \
--with-mhash \
--with-openssl \
--with-xmlrpc \
--with-xsl \
--with-bz2 \
--with-gettext \
--disable-debug \
--enable-exif \
--enable-wddx \
--enable-zip \
--enable-bcmath \
--enable-calendar \
--enable-ftp \
--enable-mbstring \
--enable-soap \
--enable-sockets \
--enable-shmop \
--enable-dba \
--enable-sysvsem \
--enable-sysvshm \
--enable-sysvmsg \
--enable-pcntl \
--with-libedit \
--with-readline
make ZEND_EXTRA_LIBS='-liconv'
make install
注:如果mysql與php不在同一服務器,則需要將上面關于mysql的參數修改為如下
--with-mysql \
--with-mysqli \
--with-pdo-mysql \
4、修改配置文件并啟動php
cp php.ini-production /home/tbt/php/lib/php.ini
cd /home/tbt/php/etc/
cp php-fpm.conf.default php-fpm.conf
cd ..
sed -i 's/^;date.timezone =/date.timezone = PRC/' /home/tbt/php/lib/php.ini
chown -R www:www /home/tbt/php
cp php.ini-production /home/tbt/php/lib/php.ini
cd /home/tbt/php/etc/
cp php-fpm.conf.default php-fpm.conf
cd ..
sed -i 's/^;date.timezone =/date.timezone = PRC/' /home/tbt/php/lib/php.ini
chown -R www:www /home/tbt/php
/home/tbt/php/sbin/php-fpm
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。