12.04 phpbrew

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

12.04 phpbrew

文章 yehlu »

https://github.com/phpbrew/phpbrew/wiki/Requirement
http://stackoverflow.com/questions/3676 ... client-dev

代碼: 選擇全部

sudo apt-get install libmariadbclient-dev
apt-get build-dep php5
apt-get install -y php5 php5-dev php-pear autoconf automake curl libcurl3-openssl-dev build-essential libxslt1-dev re2c libxml2 libxml2-dev php5-cli bison libbz2-dev libreadline-dev
apt-get install -y libgd2-xpm-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 libicu-dev
apt-get install -y libmhash-dev libmhash2
apt-get install -y libmcrypt-dev libmcrypt4
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

Re: 12.04 phpbrew

文章 yehlu »

代碼: 選擇全部

phpbrew init
phpbrew install 5.6.30 +dbs +mb +default +gd -pgsql +cgi --with-xpm-dir=/usr/share/doc/libgd2-xpm-dev/
phpbrew install 5.6.30 +dbs +mb +default +cgi
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

Re: 12.04 phpbrew System wide Environment

文章 yehlu »

https://github.com/phpbrew/phpbrew/wiki ... nvironment

Sometimes you want to share the pre-installed php(s) for your users on the same machine, you can use phpbrew to pre-install php(s) as root and let your user specifies the php version.

So there is the steps let you install phpbrew as system-wide version manager:

First, sudo as a root user or login as a root user:

sudo -i
Now initialize your phpbrew bashrc for root:

phpbrew init
Now export phpbrew paths to your desired paths, edit your ~/.phpbrew/init

export PHPBREW_ROOT=/opt/phpbrew # php dist files and build files are stored here
export PHPBREW_HOME=/root/.phpbrew # your configuration files.
Source your phpbrew bashrc

source ~/.phpbrew/bashrc
Now install system-wide php(s):

phpbrew install php-5.4.5 +default +dbs
Now your php(s) will be installed under the /opt/phpbrew path, To let your users can use php(s) built by phpbrew, you need to export PHPBREW_ROOT and PHPBREW_HOME environment in /etc/bashrc or in /etc/profile.d/phpbrew for bash users, before they load the phpbrew/bashrc file.

export PHPBREW_ROOT=/opt/phpbrew
export PHPBREW_HOME=$HOME/.phpbrew
source /opt/phpbrew/bashrc
To keep your system secure, please use root to install php(s).

a non-root user should not be able to install new php or switch

and remember to fix permissions if these files were installed by non-root user.

chown -R root: /opt/phpbrew
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

Re: 12.04 phpbrew

文章 yehlu »

代碼: 選擇全部

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

    <Directory "/var/www/php56">
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
        AddHandler php-cgi .php
        Action php-cgi /cgi-bin/php-cgi
        <FilesMatch "\.php$">
            SetHandler php-cgi
        </FilesMatch>
    </Directory>

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

Re: 12.04 phpbrew libexslt.so.0

文章 yehlu »

[Wed Feb 08 08:40:16 2017] [error] [client ] /usr/lib/cgi-bin/php-cgi: error while loading shared libraries: libexslt.so.0: cannot open shared object file: No such file or directory, referer:

https://ubuntuforums.org/showthread.php?t=462344

代碼: 選擇全部


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

Unable to load dynamic library '/usr/lib/php5/20090626/xsl.s

文章 yehlu »

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

Re: 12.04 phpbrew

文章 yehlu »

代碼: 選擇全部

curl -L -O https://github.com/phpbrew/phpbrew/raw/master/phpbrew
chmod +x phpbrew
sudo mv phpbrew /usr/local/bin/phpbrew

sudo -i
phpbrew init
vi  ~/.phpbrew/init
export PHPBREW_ROOT=/opt/phpbrew      # php dist files and build files are stored here
export PHPBREW_HOME=/root/.phpbrew    # your configuration files.
source ~/.phpbrew/bashrc

vi /etc/bashrc 
export PHPBREW_ROOT=/opt/phpbrew
export PHPBREW_HOME=$HOME/.phpbrew
source /opt/phpbrew/bashrc

phpbrew switch php-5.6.30
回覆文章

回到「Ubuntu」