Ubuntu 14.04 php 5.4

Ubuntu
回覆文章
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

Ubuntu 14.04 php 5.4

文章 yehlu »

http://askubuntu.com/questions/498175/h ... -with-lamp

代碼: 選擇全部

sudo apt-get remove --purge `dpkg -l | grep php | grep -w 5.5 | awk '{print $2}' | xargs`
wget http://www.dotdeb.org/dotdeb.gpg
sudo apt-key add dotdeb.gpg
echo "deb http://packages.dotdeb.org squeeze-php54 all" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
apt-cache policy php5
apt-get install php5=5.4.40-1~dotdeb+squeeze.1
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

Re: Ubuntu 14.04 php 5.4

文章 yehlu »

http://askubuntu.com/questions/550191/i ... -compiling

Install requirements for phpbrew

apt-get update
apt-get upgrade
apt-get build-dep php5
apt-get install -y php5 php5-dev php-pear autoconf automake curl build-essential libxslt1-dev re2c libxml2 libxml2-dev php5-cli bison libbz2-dev libreadline-dev
apt-get install -y libfreetype6 libfreetype6-dev libpng12-0 libpng12-dev libjpeg-dev libjpeg8-dev libjpeg8 libgd-dev libgd3 libxpm4 libltdl7 libltdl-dev
apt-get install -y libssl-dev openssl
apt-get install -y gettext libgettextpo-dev libgettextpo0
apt-get install -y php5-cli
apt-get install -y libmcrypt-dev
apt-get install -y libreadline-dev
Install phpbrew

curl -L -O https://github.com/phpbrew/phpbrew/raw/master/phpbrew
chmod +x phpbrew
sudo mv phpbrew /usr/bin/phpbrew
Initialise phpbrew, update and install PHP 5.4

phpbrew init
phpbrew known --update
phpbrew update
Here we choose PHP 5.4.34, but you can change this to any version that is available as listed by the above commands - like 5.5.22.

phpbrew install 5.4.34 +default
Switch the default PHP version to 5.4

phpbrew switch php-5.4.34
Check your PHP version

php -v
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

apxs binary is not executable

文章 yehlu »

sudo apt-get install apache2-dev
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

Re: Ubuntu 14.04 php 5.4

文章 yehlu »

phpbrew install 5.4.41 +apxs2 +gd +mysql +curl +mbstring +json
phpbrew extension install gd

phpbrew install 5.4.41 +default +apxs2 +dbs +intl

root@yehlu-VirtualBox:/var/www/html# cat /etc/apache2/mods-enabled/php5.load
#LoadModule php5_module /usr/lib/apache2/modules/libphp5.so
LoadModule php5_module /usr/lib/apache2/modules/libphp5.4.41.so

vi /root/.phpbrew/php/php-5.4.41/etc/php.ini
date.timezone = Asia/Taipei
session.save_path = "/tmp"
mysql.default_socket = /var/run/mysqld/mysqld.sock
mysqli.default_socket = /var/run/mysqld/mysqld.sock
pdo_mysql.default_socket = /var/run/mysqld/mysqld.sock
回覆文章

回到「Ubuntu」