centos64位lamp配置第三步:编译php5.3.27
下载php-5.3.27.tar.gz,解压tar -zxvf php-5.3.27,确保已经安装了yum -y install wget gcc-c ncurses ncurses-devel cmake make perl bison openssl openssl-devel gcc* libevent libevent-devel libxml2 libxml2-devel libmcrypt libmcrypt-devel curl-deve
下载php-5.3.27.tar.gz,解压tar -zxvf php-5.3.27,确保已经安装了yum -y install wget gcc-c++ ncurses ncurses-devel cmake make perl bison openssl openssl-devel gcc* libevent libevent-devel libxml2 libxml2-devel libmcrypt libmcrypt-devel curl-devel libpng-devel libtool-ltdl-devel libjpeg* libpng* freetype* zlib zlib-devel openldap openldap-devel libxslt-devel* bzip2-devel
执行:cp -frp /usr/lib64/libldap* /usr/lib/
安装mhash:
# tar zxvf mhash-0.9.9.tar.gz<br> # cd mhash-0.9.9
# mkdir -p /usr/local/mhash<br> # ./configure prefix=/usr/local/mhash<br> # make && make install<br>
安装libmcrpt:
wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/attic/libmcrypt/libmcrypt-2.5.7.tar.gz<br>
tar -zxvf libmcrypt-2.5.7.tar.gz <br> cd libmcrypt-2.5.7 <br> mkdir -p /usr/local/libmcrytp <br> ./configure prefix=/usr/local/libmcrytp/ #默认也可以<br> make<br> make install <br>
这些准备环境。
<br>
进入php-5.3.27目录,执行./configure,如果是在nginx之前编译,要去掉
<span><strong>--with-apxs2=/usr/local/apache/bin/apxs,--with-iconv=/usr/local/libiconv改为--with-iconv</strong></span>
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-openssl --with-zlib --with-bz2 --with-gettext --with-mhash --with-mcrypt --with-iconv=/usr/local/libiconv --with-curl --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-pdo --enable-gd-native-ttf --enable-bcmath --enable-mbstring --enable-zip --enable-soap --enable-sockets --enable-ftp --without-pear --enable-fpm --enable-inline-optimization
下面是参考:
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-iconv-dir=/usr/local/libiconv --with-libxml-dir=/usr --enable-xml --with-curl --with-curlwrappers --with-mhash --with-mcrypt=/usr/local/libmcrytp --with-gd --enable-gd-native-ttf --with-xsl --with-openssl --with-ldap --with-ldap-sasl --with-xmlrpc --without-pear --with-plugins=innobase --without-debug --with-charset=utf8 --with-collation=utf8_unicode_ci --with-extra-charsets=utf8 --with-pthread --enable-static --enable-safe-mode --enable-thread-safe-client --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static --enable-thread-safe-client --with-mysqld-user=mysql --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-pdo --with-big-tables --without-debug --with-jpeg-dir=/usr/lib --with-png-dir --with-freetype-dir --with-zlib --enable-mbstring --with-pear --enable-mbregex --enable-zend-multibyte --enable-sockets --enable-soap --enable-exif --with-mhash=/usr/local/mhash --with-apxs2=/usr/local/apache/bin/apxs --enable-fpm --enable-inline-optimization<br>完成后会看到thank you for use php字样
make
make install
没有出现error就ok了。
cp php.ini-production /usr/local/php/etc/php.ini
sed -i 's/;date.timezone =/date.timezone = Asia\/Shanghai/g' /usr/local/php/etc/php.ini<br> sed -i 's/short_open_tag = Off/short_open_tag = On/g' /usr/local/php/etc/php.ini<br> sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g' /usr/local/php/etc/php.ini<br> sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 50M/g' /usr/local/php/etc/php.ini<br> sed -i '262i output_buffering = On' /usr/local/php/etc/php.ini<br>
配置php-fpm:
cp sapi/fpm/init.d.php-fpm /etc/rc.d/init.d/php-fpm
chmod +x /etc/init.d/php-fpm
chkconfig --add php-fpm
chkconfig php-fpm on
<br>
# cd /usr/local/php/etc/
# cp php-fpm.conf.default php-fpm.conf
# vi php-fpm.conf //一般配置的依据如下
内存小于4G服务器(值可逐级递减):
修改如下参数:
pm=dynamic
pm.max_children=40
pm.start_servers=10
pm.min_spare_servers=10
pm.max_spare_servers=40
******************************
内存大于4G服务器(值可逐级递增):
修改如下参数:
pm=static
pm.max_children=100
<br>
<br>
安装pdo-mysql:
tar zxvf PDO_MYSQL-1.0.2.tgz<br>
cd PDO_MYSQL-1.0.2/<br>
/usr/local/php/bin/phpize<br>
./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql=/usr/local/mysql<br>
make && make install<br>
修改Php.ini:
extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/"<br> extension = "pdo_mysql.so"<br>
service php-fpm start<br>vim /usr/local/apache/conf/httpd.conf
查找AddType
添加:AddType application/x-httpd-php .php
查找DirectoryIndex,在DirectoryIndex后面添加index.php
DirectoryIndex index.php index.html
查找:LoadModule php5_module modules/libphp5.so
如果没有就添加,使用phpinfo()测试,能输出php信息就ok了。

熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

AI Hentai Generator
免費產生 AI 無盡。

熱門文章

熱工具

記事本++7.3.1
好用且免費的程式碼編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發環境

Dreamweaver CS6
視覺化網頁開發工具

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

熱門話題

標題:Linux系統中GDM的工作原理及設定方法在Linux作業系統中,GDM(GNOMEDisplayManager)是一種常見的顯示管理器,用於控制圖形使用者介面(GUI)登入和使用者會話管理。本文將介紹GDM的工作原理和設定方法,以及提供具體的程式碼範例。一、GDM的工作原理GDM是GNOME桌面環境下的顯示管理器,負責啟動X伺服器並提供登入介面,使用者輸

PyCharm是一款強大的整合開發環境(IDE),而PyTorch則是深度學習領域備受歡迎的開源架構。在機器學習和深度學習領域,使用PyCharm和PyTorch進行開發可以大大提高開發效率和程式碼品質。本文將詳細介紹如何在PyCharm中安裝設定PyTorch,並附上具體的程式碼範例,幫助讀者更好地利用這兩者的強大功能。第一步:安裝PyCharm和Python

了解LinuxBashrc:功能、配置與使用方法在Linux系統中,Bashrc(BourneAgainShellruncommands)是一個非常重要的配置文件,其中包含了系統啟動時自動運行的各種命令和設定。 Bashrc文件通常位於使用者的家目錄下,是一個隱藏文件,它的作用是為使用者自訂設定Bashshell的環境。一、Bashrc的功能設定環境

Win11系統如何設定工作群組工作群組是一種在區域網路中連接多台電腦的方式,它允許電腦之間共用檔案、印表機和其他資源。在Win11系統中,設定工作群組非常簡單,只需依照下列步驟操作即可。步驟1:開啟「設定」應用程式首先,點擊Win11系統的「開始」按鈕,然後在彈出的選單中選擇「設定」應用程式。你也可以使用快捷鍵“Win+I”開啟“設定”。步驟2:選擇「系統」在「設定」應用程式中,你會看到多個選項。請點選「系統」選項,進入系統設定頁面。步驟3:選擇「關於」在「系統」設定頁面中,你會看到多個子選項。請點

MyBatisGenerator是MyBatis官方提供的程式碼產生工具,可以幫助開發人員快速產生符合資料庫表結構的JavaBean、Mapper介面以及XML映射檔。在使用MyBatisGenerator進行程式碼產生的過程中,配置參數的設定是至關重要的。本文將從配置參數的角度出發,深入探討MyBatisGenerator的

標題:Linux系統中如何配置和安裝FTPS,需要具體程式碼範例在Linux系統中,FTPS是一種安全的檔案傳輸協議,與FTP相比,FTPS透過TLS/SSL協議對傳輸的資料進行加密,提高了資料傳輸的安全性。在本文中,將介紹如何在Linux系統中設定和安裝FTPS,並提供特定的程式碼範例。步驟一:安裝vsftpd開啟終端,輸入以下指令安裝vsftpd:sudo

Flask安裝設定教學:輕鬆建置PythonWeb應用的利器,需要具體程式碼範例引言:隨著Python的日益流行,Web開發也成為了Python程式設計師的必備技能之一。而要進行Python的Web開發,我們需要選擇適合的Web框架。在眾多的PythonWeb框架中,Flask是一款簡潔、易上手且靈活的框架,備受開發者的青睞。本文將介紹Flask框架的安裝、

我們在使用win11系統的時候有時候會需要查看自己的電腦配置,但是也有不少的用戶們在詢問win11電腦配置在哪裡看?其實方法很簡單的,使用者可以直接的開啟設定下的系統訊息,然後就能查看電腦設定資訊。以下就讓本站來為使用者來仔細的介紹一下win11電腦設定資訊如何查找方法吧。 win11電腦設定資訊如何找出方法方法一:1、點選開始,開啟電腦設定。 3、在此頁面即可查看電腦設定資訊。 2.在指令提示字元視窗中,輸入systeminfo回車,即可查看電腦設定。
