- php-5.5.15.tar.gz
一、下載及安裝
sudo wget http://us1.php.net/distributions/php-5.5.15.tar.gz
sudo gzip -d php-5.5.15.tar.gz
sudo tar xvf php-5.5.15.tar
cd php-5.5.15
sudo ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-zlib --with-gd --with-mhash --with-mcrypt --with-curl --with-openssl --with-zlib --with-jpeg-dir --with-png-dir --with-pcre-regex --enable-calendar --enable-exif --enable-ftp --enable-mbstring --enable-shmop --enable-soap --enable-sockets --enable-wddx --enable-zip
sudo make
sudo make test
sudo make install
cp php.ini-development /usr/local/lib/php.ini
sudo mkdir java
二、與Apache2整合
sudo vim /usr/local/apache2/conf/httpd.conf請先找到的訊息:
#LoadModule php5_module modules/libphp5.so註解拿掉:
LoadModule php5_module modules/libphp5.so在最底下新增以下的訊息:
<filesmatch \.php$=""> SetHandler application/x-httpd-php </filesmatch> AddType application/x-httpd-php .php .html .htm AddHandler php5-script .php儲存後,離開。
重啟Apache2 server
sudo service apache2 restart
三、測試PHP
sudo vim /usr/local/apache2/htdocs/info.php內容為底下:
<?php phpinfo(); ?>測試鏈結以下:
http://127.0.0.1/info.php
參考鍵結:
https://www.virgohacks.net/install-apache-2-4-mysql-5-6-php-5-5-source-ubuntu-14-04/
http://www.rootusers.com/installing-apache-2-4-and-php-5-4-from-source/
沒有留言:
張貼留言