kaedah pemasangan php5.3: 1. Pasang melalui sudo apt-get; 2. Susun dan pasang;
Persekitaran pengendalian artikel ini: sistem centOS6.8, versi php5.3, komputer DELL G3
php5.3 tutorial pemasangan
pemasangan php5.3
sudo apt-get install gcc sudo apt-get install g++ sudo apt-get install autoconf sudo apt-get install libxml2 sudo apt-get install libxml2-dev sudo apt-get install libevent-1.4-2 sudo apt-get install libevent-dev sudo apt-get install bzip2 sudo apt-get install libbz2-dev sudo apt-get install libcurl3-gnutls sudo apt-get install libcurl4-gnutls-dev sudo apt-get install libpng12-0 sudo apt-get install libpng12-dev sudo apt-get install libjpeg62 sudo apt-get install libjpeg62-dev sudo apt-get install libfreetype6 sudo apt-get install libfreetype6-dev sudo apt-get install libmcrypt4 sudo apt-get install libmcrypt-dev sudo apt-get install zlib1g-dev sudo apt-get install libtidy-dev
sudo apt-get install autoconf g++ libxml2-dev libevent-dev libbz2-dev libcurl4-gnutls-dev libpng12-dev libjpeg62-dev libfreetype6-dev libmcrypt-dev zlib1g-dev ./configure --prefix=/usr/local/php55 --with-gettext --with-mysql=mysqlnd --with-gd --with-jpeg-dir --with-png-dir --with-curl --with-freetype-dir --enable-gd-native-ttf --enable-mbstring --enable-sockets --with-mcrypt --with-pdo-mysql=mysqlnd --enable-fpm --with-zlib --enable-zip --with-bz2 --enable-bcmath --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-pcntl
Nota:
Jika ia RH, anda perlukan:
yum -y install curl-devel yum install libjpeg-devel yum install libpng-devel yum install freetype-devel yum install -y libmcrypt-devel.x86_64 yum install -y libxml2-devel.x86_64 yum install -y bzip2-devel.x86_64 yum install libtool-ltdl-devel (在 make的时候会出现:/usr/bin/ld: cannot find -lltdl) yum install autoconf yum install -y libtidy-devel.x86_64
Kompil dan pasang
./configure --prefix=/usr/local/php-5.3.3 --with-gettext --with-mysql=mysqlnd --with-gd --with-jpeg-dir --with-png-dir --with-curl --with-freetype-dir --enable-gd-native-ttf --enable-mbstring --enable-sockets --with-mcrypt --with-pdo-mysql=mysqlnd --enable-fpm --with-zlib --enable-zip --with-bz2 --enable-bcmath --with-tidy make make install
Selepas penyusunan dan pemasangan selesai, anda masih perlu mengkonfigurasi php-fpm, kerana php5.3 tidak lagi memerlukan patch php -fpm, jadi cara mengawal php-fpm (memulakan, memulakan semula) perlu diubah. Langkah-langkahnya adalah seperti berikut:
Salin daripada pakej sumber:
sudo path/to/php-source/folder/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm sudo chmod a+x /etx/init.d/php-fpm
Kemudian anda boleh lulus/etc/init.d/php-fpm (mula|stop|force-quit| mulakan semula|muat semula ) untuk mengawal
pemasangan sambungan am
memcached:
wget http://pecl.php.net/get/memcache-2.2.5.tgz tar -xvf memcache-2.2.5.tgz cd memcache-2.2.5 /usr/local/php-5.3.3/bin/phpize ./configure --with-php-config=/usr/local/php-5.3.3/bin/php-config make make install
solr
wget http://pecl.php.net/get/solr-0.9.11.tgz tar -xvf solr-0.9.11.tgz cd solr-0.9.11 /usr/local/php-5.3.3/bin/phpize ./configure --with-php-config=/usr/local/php-5.3.3/bin/php-config make make install
xcache
wget http://xcache.lighttpd.net/pub/Releases/1.3.0/xcache-1.3.0.tar.bz2 tar -xjvf xcache-1.3.0.tar.bz2 cd xcache-1.3.0 /usr/local/php-5.3.3/bin/phpize ./configure --with-php-config=/usr/local/php-5.3.3/bin/php-config make make install
php_ini
expose_php = off error_reporting = E_ALL display_errors = On short_open_tag = On extension=memcache.so extension=xcache.so extension=solr.so bbs需要 ;log_errors = on error_log = syslog linux系统可以使用这个,把errorlog 输出到syslog中 date.timezone = Asia/Shanghai
Pembelajaran yang disyorkan: "Tutorial Video PHP"
Atas ialah kandungan terperinci Tutorial pemasangan php5.3. Untuk maklumat lanjut, sila ikut artikel berkaitan lain di laman web China PHP!