導航:首頁 > 編程語言 > phpsasl

phpsasl

發布時間:2023-12-14 15:16:00

❶ 如何在linux下安裝多個不同版本的php

Linux (測試環境 Ubuntu 12.04 Server X86_64)
1. 安裝編譯工具及所需類庫
$ sudo apt-get install build-essential gcc g++ autoconf libjpeg62 libjpeg62-dev libpng12-0 libpng12-dev libfreetype6 libfreetype6-dev libxml2 libxml2-dev zlib1g zlib1g-dev bzip2 libbz2-dev openssl libssl-dev curl libcurl4-openssl-dev libpcre3 libpcre3-dev libevent-1.4-2 libevent-dev libmcrypt4 libmcrypt-dev mcrypt libltdl-dev libldap2-dev libsasl2-dev libmhash-dev libc-client2007e libc-client2007e-dev
2. 安裝MySQL
$ sudo apt-get install mysql-server libmysqlclient-dev
3. 安裝PHP
Linux下多版本PHP共存需要自己手工編譯安裝。
下載PHP源文件到/opt/src目錄
$ mkdir /opt/src
$ cd /opt/src
$ wget http://museum.php.net/php5/php-5.2.17.tar.bz2 -O php-5.2.17.tar.bz2
$ wget http://cn2.php.net/get/php-5.3.28.tar.bz2/from/this/mirror -O php-5.3.28.tar.bz2
$ wget http://cn2.php.net/get/php-5.4.29.tar.bz2/from/this/mirror -O php-5.4.29.tar.bz2
$ wget http://cn2.php.net/get/php-5.5.14.tar.bz2/from/this/mirror -O php-5.5.14.tar.bz2
創建PHP各版本安裝目錄
$ mkdir -p /opt/php/{5217,5328,5429,5514}
安裝PHP 5.2.17
$ cd /opt/src
$ tar -xvjf php-5.2.17.tar.bz2
$ cd php-5.2.17
$ sudo ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib/libjpeg.so
$ sudo ln -s /usr/lib/x86_64-linux-gnu/libpng.so /usr/lib/libpng.so
$ sudo ln -s /usr/lib/x86_64-linux-gnu/libkrb5.so /usr/lib/libkrb5.so
$ wget -O debian_patches_disable_SSLv2_for_openssl_1_0_0.patch 「https://bugs.php.net/patch-display.php?bug_id=54736&patch=debian_patches...」
$ patch -p1 < debian_patches_disable_SSLv2_for_openssl_1_0_0.patch
$ ./configure --prefix=/opt/php/5217 --with-config-file-scan-dir=/opt/php/5217/etc/php.d --with-mysql --with-pdo-mysql --with-mysqli --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --enable-ftp --disable-debug --disable-ipv6 --disable-short-tags --enable-calendar --with-mime-magic --with-imap --with-imap-ssl --with-kerberos
$ make
$ sudo make install
$ cp php.ini-recommended /opt/php/5217/lib/php.ini
安裝PHP 5.3.28
$ cd /opt/src
$ tar -xvjf php-5.3.28.tar.bz2
$ cd php-5.3.28
$ ./configure --prefix=/opt/php/5328 --with-config-file-scan-dir=/opt/php/5328/etc/php.d --with-mysql --with-pdo-mysql --with-mysqli --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --enable-ftp --disable-debug --disable-ipv6 --disable-short-tags --enable-calendar --with-imap --with-imap-ssl --with-kerberos
$ make
$ sudo make install
$ cp php.ini-development /opt/php/5328/lib/php.ini
安裝PHP 5.4.29
$ cd /opt/src
$ tar -xvjf php-5.4.29.tar.bz2
$ cd php-5.4.29
$ ./configure --prefix=/opt/php/5429 --with-config-file-scan-dir=/opt/php/5429/etc/php.d --with-mysql --with-pdo-mysql --with-mysqli --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --enable-ftp --disable-debug --disable-ipv6 --disable-short-tags --enable-calendar --with-imap --with-imap-ssl --with-kerberos
$ make
$ sudo make install
$ cp php.ini-development /opt/php/5429/lib/php.ini
安裝PHP 5.5.14
$ cd /opt/src
$ tar -xvjf php-5.5.14.tar.bz2
$ cd php-5.5.14
$ ./configure --prefix=/opt/php/5514 --with-config-file-scan-dir=/opt/php/5514/etc/php.d --with-mysql --with-pdo-mysql --with-mysqli --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --enable-ftp --disable-debug --disable-ipv6 --disable-short-tags --enable-calendar --with-imap --with-imap-ssl --with-kerberos
$ make
$ sudo make install
$ cp php.ini-development /opt/php/5514/lib/php.ini
4. 安裝Apache
$ sudo apt-get install apache2
啟用相應模塊
$ a2enmod headers
$ a2enmod expires
$ a2enmod actions
$ a2enmod rewrite
5. 配置Apache
$ sudo vi /etc/apache2/httpd.conf
追加如下腳本映射和虛擬主機配置,原理同Windows的配置說明。
ServerName localhost
AddType application/x-httpd-php .php
ScriptAlias /php-5217/ "/opt/php/5217/bin/"
ScriptAlias /php-5328/ "/opt/php/5328/bin/"
ScriptAlias /php-5429/ "/opt/php/5429/bin/"
ScriptAlias /php-5514/ "/opt/php/5514/bin/"
<Directory /var/www/sites>
Options Indexes FollowSymLinks Includes ExecCGI
DirectoryIndex index.php index.html
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory /var/www/sites/5217>
Action application/x-httpd-php "/php-5217/php-cgi"
</Directory>
<Directory /var/www/sites/5328>
Action application/x-httpd-php "/php-5328/php-cgi"
</Directory>
<Directory /var/www/sites/5429>
Action application/x-httpd-php "/php-5429/php-cgi"
</Directory>
<Directory /var/www/sites/5514>
Action application/x-httpd-php "/php-5514/php-cgi"
</Directory>
# Virtualhosts
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "/var/www/sites/5217/test.local"
ServerName php5217.local
ErrorLog "/var/log/apache2/php5217.local-error.log"
CustomLog "/var/log/apache2/php5217.local-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "/var/www/sites/5328/test.local"
ServerName php5328.local
ErrorLog "/var/log/apache2/php5328.local-error.log"
CustomLog "/var/log/apache2/php5328.local-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "/var/www/sites/5429/test.local"
ServerName php5429.local
ErrorLog "/var/log/apache2/php5429.local-error.log"
CustomLog "/var/log/apache2/php5429.local-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "/var/www/sites/5514/test.local"
ServerName php5514.local
ErrorLog "/var/log/apache2/php5514.local-error.log"
CustomLog "/var/log/apache2/php5514.local-access.log" common
</VirtualHost>
保存配置後,創建各站點的DocumentRoot目錄,再往每個目錄放置一個phpinfo的測試文件,完成後重啟Apache伺服器並在本地hosts文件加入域名解析,現在就可以訪問各站點來測試多版本PHP共存了。

好了,基本的多版本PHP共存解決方案已經完成,如果還需要添加其他的PHP類庫支持,後續自己再調用對應php目錄下的pecl, php_config等腳本編譯安裝就可以了。

❷ 編譯php,make test的時候出錯,大家幫看看是什麼原因。

Can't bind to LDAP Server - [-1]
ldap_open() 函數打開一個到LDAP伺服器的聯接。
如果出錯,返回-1,並在LDAP結構中設置ld_errno域。
建議重下個安裝文件試試

編程都有哪些語言

目前熱門的語言有:C、C++、JAVA、VB、VC、FoxPro、Delphi、SQL、PHP、ASP、JSP等等。

專門有機構為編程語言進行排名,如下圖:

閱讀全文

與phpsasl相關的資料

熱點內容
換手率app怎麼沒有自媒體了 瀏覽:407
安卓如何區分展示機和正品機 瀏覽:371
java運行和編譯命令 瀏覽:543
手機解壓30g文件要多久 瀏覽:708
php讀取文件格式 瀏覽:612
開發程序員的電影 瀏覽:743
pc端解壓文件下載 瀏覽:708
單片機C語言讀寄存器 瀏覽:164
linux火車源碼 瀏覽:793
小米手機應用加密怎樣解除 瀏覽:523
幫孩子解壓的句子 瀏覽:140
木匠編程 瀏覽:832
笑話pdf 瀏覽:441
pdf變形 瀏覽:852
微信app最下面的菜單欄叫什麼 瀏覽:249
我的世界晚上七點有什麼伺服器 瀏覽:176
雲伺服器不見了怎麼辦 瀏覽:965
怎麼看電腦ntp伺服器地址 瀏覽:579
程序員是干什麼的需要什麼素質 瀏覽:371
程序員畫圖工具哪個好 瀏覽:760