導航:首頁 > 源碼編譯 > 編譯php時的參數

編譯php時的參數

發布時間:2022-09-03 02:07:42

『壹』 編譯php要用什麼樣的參數,才能支持遠程連接Mysql伺服器

和PHP沒關系,要設置MYSQL
用root用戶進資料庫,選擇mysql庫,user表裡,把對應用戶(比如root)的Host改為%號(任意IP,不分本地遠程),或者改為某一IP(指定IP登錄),再重啟下MYSQL,就可以遠程訪問MYSQL了。

『貳』 php編譯後漏掉一些參數怎麼辦

比如添加bcmath模塊:(在編譯時沒有添加 --enable-bcmath)

# cd php-5.3.10/ext/bcmath
# /usr/local/php/bin/phpize
# ./configure --with-php-config=/usr/local/php/bin/php-config
# make && make install
# cp /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/bcmath.so
/usr/lib/php/moles
# vi /usr/local/php/etc/php.ini
[bcmath]
extension=bcmath.so
:wq

重啟apache:

# /usr/local/apache/bin/apachectl restart

『叄』 ./configure編譯php時這個問題如何解決

PHP的安裝雖然有時候很簡單,可是如果應用一多,我們安裝起來就很頭痛了!出錯最多的就是安裝PHP擴展的時候了。其實不管是你是Apache類的應用還是Nginx類的,PHP的安裝都不是很簡單,雖然網上有很多configure參數,但是那不一定是適合你的,因為很多都直接關系著你的系統版本和內核。因此要自己親自不斷的調試,才能完全安裝成功。
本文總結了一些常見的configure錯誤信息和解決這些錯誤的經驗。
1、configure: error: No curses/termcap library found
網上有的說法是:–with-named-curses-libs=/usr/lib/libncursesw.so.5
其實是不對的,雖然能解決configure的錯誤,但是make的時候會提示錯誤,正確的做法應該是
centos: yum -y install ncurses-devel
debian: apt-get install libncurses5-dev
2、configure: error: xml2-config not found. Please check your libxml2 installation.
centos: yum -y install libxml2 libxml2-devel
debian: apt-get install libxml2-dev
3、configure: error: Cannot find OpenSSL』s
centos: yum -y install openssl-devel
4、configure: error: libjpeg.(a|so) not found
centos: yum -y install gd
centos: yum -y install gd-devel
debian: apt-get install libjpeg-dev
5、configure: error: libpng.(a|so) not found.
apt-get install libpng12-dev
6、configure: error: cannot find output from lex; giving up
yum -y install flex
7、configure: error: mod_deflate has been requested but can not be built e to prerequisite failures
centos: yum -y install zlib-devel openssl-devel
debian: apt-get install zlib1g-dev
8、configure: error: libxpm.(a|so) not found.
centos: yum -y install libxpm-dev
debian: apt-get install libxpm-dev
9、configure: error: freetype.h not found.
centos: yum install freetype-devel
debian: apt-get install libfreetype6-dev
10、configure: error: …No recognized SSL/TLS toolkit detected
centos: yum -y install libssl-dev
debian: apt-get install libssl-dev
11、Configure: error: Please reinstall the BZip2 distribution
centos: yum install bzip2 bzip2-devel
debian: apt-get install bzip2-devel
12、Configure: error: Please reinstall the libcurl distribution – easy.h should be in /include/curl/
centos: yum install curl curl-devel (For Redhat & Fedora)
# install libcurl4-gnutls-dev (For Ubuntu)
13、Configure: error: Unable to locate gmp.h
centos: yum install gmp-devel
14、Configure: error: Cannot find MySQL header files under /usr. Note that the MySQL client library is not bundled anymore!
yum install mysql-devel (For Redhat & Fedora)
# apt-get install libmysql++-dev (For Ubuntu)
15、Configure: error: Please reinstall the ncurses distribution
Solutions :
centos: yum install ncurses ncurses-devel
16、Checking for unixODBC support… configure: error: ODBC header file 『/usr/include/sqlext.h』 not found!
Solutions :
centos: yum install unixODBC-devel
17、Configure: error: Cannot find pspell
Solutions :
centos: yum install pspell-devel
18、configure: error: mcrypt.h not found. Please reinstall libmcrypt.
Solutions :
yum install libmcrypt libmcrypt-devel (For Redhat & Fedora)
# apt-get install libmcrypt-dev
19、Configure: error: snmp.h not found. Check your SNMP installation.
Solutions :
yum install net-snmp net-snmp-devel
20、開啟LDAP服務還需要
yum -y install openldap-devel openldap-servers openldap-clients
21、configure: error: cannot find output from lex; giving up
centos: yum -y install flex
22、configure: error: mod_deflate has been requested but can not be built e to prerequisite failures
centos: yum -y install zlib-devel openssl-devel
debian: apt-get install zlib1g-dev

『肆』 求助,centos7編譯源碼php時載入庫的問題

php-fpm參數:

--start 啟動
--stop 強制終止
--quit 平滑終止
--restart 重啟
--reload 重新平滑載入php的php.ini
--logrotate 重新啟用log文件

『伍』 編譯PHP提示出錯找不到libc-client.無法編譯PHP怎麼辦

I. 安裝devel庫
yum install pam-devel libc-client libc-client-devel -y
如果使用了yum安裝了libc-client,那麼在以後編譯參數--with-imap=/usr/local/php-imap中的路徑應該刪除,即--with-imap。
如果這樣還不能解決,那麼就需要手動編譯imap2007f了!
II. 手動編譯imap2007f
腳本取自 http://forum.directadmin.com/showthread.php?t=45434
在/usr/src目錄下運行以下腳本,將會在/usr/local/php-imap目錄下生成imap需要的庫
#!/bin/sh
# Script for PHP-IMAP installation. 0.1b
# Written by Martynas Bendorius (smtalk)
CWD=`pwd`
OS=`uname`
#Is it a 64-bit OS?
B64=0
B64COUNT=`uname -m | grep -c 64`
if [ "$B64COUNT" -eq 1 ]; then
B64=1
LD_LIBRARY_PATH=/lib64:/usr/lib64:/usr/local/lib64:/lib:/usr/lib:/usr/local/lib
export LD_LIBRARY_PATH
fi
if [ ! -e /usr/include/krb5.h ] && [ -e /etc/redhat-release ]; then
echo "Installing krb5-devel"
yum -y install krb5-devel
fi
VERSION=2007f
PROTOCOL=ftp
URL="${PROTOCOL}://ftp.cac.washington.e/imap/imap-${VERSION}.tar.Z"
FILENAME=imap-${VERSION}
TARBALL=${FILENAME}.tar.Z
echo "Downloading ${TARBALL}..."
wget -O ${TARBALL} ${URL}
tar xzf ${TARBALL}
cd ${FILENAME}
echo "Installing ${FILENAME}..."
if [ ${OS} = "FreeBSD" ]; then
if [ ${B64} -eq 0 ]; then
make bsf
else
make bsf EXTRACFLAGS=-fPIC
fi
else
perl -pi -e 's#SSLDIR=/usr/local/ssl#SSLDIR=/etc/pki/tls#' src/osdep/unix/Makefile
perl -pi -e 's#SSLINCLUDE=\$\(SSLDIR\)/include#SSLINCLUDE=/usr/include/openssl#' src/osdep/unix/Makefile
perl -pi -e 's#SSLLIB=\$\(SSLDIR\)/lib#SSLLIB=/usr/lib/openssl#' src/osdep/unix/Makefile
if [ ${B64} -eq 0 ]; then
make slx
else
make slx EXTRACFLAGS=-fPIC
fi
fi
echo "Copying files to /usr/local/php-imap"
mkdir -p /usr/local/php-imap/include
mkdir -p /usr/local/php-imap/lib
chmod -R 077 /usr/local/php-imap
cp -f c-client/*.h /usr/local/php-imap/include/
cp -f c-client/*.c /usr/local/php-imap/lib/
cp -f c-client/c-client.a /usr/local/php-imap/lib/libc-client.a
cd ..
rm -rf ${FILENAME}
if [ -d /usr/lib/x86_64-linux-gnu ] && [ ! -d /usr/kerberos/lib ]; then
mkdir -p /usr/kerberos
ln -s /usr/lib/x86_64-linux-gnu /usr/kerberos/lib
fi

exit 0;
III. 開始編譯
下面是編譯PHP的參數,如果出現問題,請參考編譯PHP5.6 和 PHP編譯錯誤的解決辦法。
./configure --prefix=/usr/local/php --with-pdo-pgsql --with-zlib-dir --with-freetype-dir --enable-mbstring --with-libxml-dir=/usr --enable-soap --enable-calendar --with-curl --with-mcrypt --with-zlib --with-gd --with-pgsql --disable-rpath --enable-inline-optimization --with-bz2 --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --enable-exif --enable-bcmath --with-mhash --enable-zip --with-pcre-regex --with-mysql --with-pdo-mysql --with-mysqli --with-jpeg-dir=/usr --with-png-dir=/usr --enable-gd-native-ttf --with-openssl --enable-ftp --with-imap=/usr/local/php-imap --with-imap-ssl --with-kerberos --with-gettext --with-xmlrpc --with-xsl --enable-opcache --enable-fpm --with-fpm-user=www --with-fpm-group=www --disable-fileinfo
IV. 其他問題
在本次編譯中,老高又遇到了幾個怪事
set --enable-opcache=no
configure: error: Don't know how to define struct flock on this system, set --enable-opcache=no
這個問題還是庫文件的鏈接問題
解決:
echo /usr/local/lib > /etc/ld.so.conf.d/local.conf
ldconfig -v
讓編譯的PHP支持memcache

『陸』 linux下安裝php編譯參數

在Linux下安裝PHP,源代碼方式安裝,總需要配置很多參數。這里列出常用配置參數,並詳細用中文解釋說明了。給大家一些參考./configure
--prefix=/usr/local/php
php
安裝目錄
--with-apxs2=/usr/local/apache/bin/apxs
--with-config-file-path=/usr/local/php/etc
指定php.ini位置
--with-MySQL=/usr/local/mysql
mysql安裝目錄,對mysql的支持
--with-mysqli=/usr/local/mysql/bin/mysql_config
mysqli文件目錄,優化支持
--enable-safe-mode
打開安全模式
--enable-ftp
打開ftp的支持
--enable-zip
打開對zip的支持
--with-bz2
打開對bz2文件的支持
--with-jpeg-dir
打開對jpeg圖片的支持
--with-png-dir
打開對png圖片的支持
--with-freetype-dir
打開對freetype字體庫的支持
--without-iconv
關閉iconv函數,種字元集間的轉換
--with-libXML-dir
打開libxml2庫的支持
--with-xmlrpc
打開xml-rpc的c語言
--with-zlib-dir
打開zlib庫的支持
--with-gd
打開gd庫的支持
--enable-gd-native-ttf
支持TrueType字元串函數庫
--with-curl
打開curl瀏覽工具的支持
--with-curlwrappers
運用curl工具打開url流
--with-ttf
打開freetype1.*的支持,可以不加了
--with-xsl
打開XSLT
文件支持,擴展了libxml2庫
,需要libxslt軟體
--with-gettext
打開gnu
的gettext
支持,編碼庫用到
--with-pear
打開pear命令的支持,php擴展用的
--enable-calendar
打開日歷擴展功能
--enable-mbstring
多位元組,字元串的支持
--enable-bcmath
打開圖片大小調整,用到zabbix監控的時候用到了這個模塊
--enable-sockets
打開
sockets
支持
--enable-exif
圖片的元數據支持
--enable-magic-quotes
魔術引用的支持
--disable-rpath
關閉額外的運行庫文件
--disable-debug
關閉調試模式
--with-mime-magic=/usr/share/file/magic.mime
魔術頭文件位置
CGI方式安裝才用的參數
--enable-fpm
打上php-fpm
補丁後才有這個參數,cgi方式安裝的啟動程序
--enable-fastcgi
支持fastcgi方式啟動php
--enable-force-cgi-redirect
同上
,幫助里沒有解釋
--with-ncurses
支持ncurses
屏幕繪制以及基於文本終端的圖形互動功能的動態庫
--enable-pcntl
freeTDS需要用到的,可能是鏈接mssql
才用到
mhash和mcrypt演算法的擴展
--with-mcrypt
演算法
--with-mhash
演算法
--with-gmp
--enable-inline-optimization
--with-openssl
openssl的支持,加密傳輸時用到的
--enable-dbase
--with-pcre-dir=/usr/local/bin/pcre-config
perl的正則庫案安裝位置
--disable-dmalloc
--with-gdbm
dba的gdbm支持
--enable-sigchild
--enable-sysvsem
--enable-sysvshm
--enable-zend-multibyte
支持zend的多位元組
--enable-mbregex
--enable-wddx
--enable-shmop
--enable-soap

『柒』 哪些是編譯php時的常用configure參數

分版本的,不同版本有一點點區別。大部分都是一樣的。
比如PHP7.1.5可以參考以下:
./configure --prefix=/ueidc/php715 --with-config-file-path=/ueidc/php715/ --with-config-file-scan-dir=/ueidc/php715/etc --with-openssl=/ueidc/openssl110f --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-mysqlnd --enable-sockets --enable-mbstring --enable-fpm --enable-soap --enable-gd-native-ttf --enable-opcache=no --with-gettext --with-png-dir=/ueidc/libpng162 --with-jpeg-dir=/ueidc/jpeg9 --with-zlib-dir=/ueidc/zlib128 --with-libxml-dir=/ueidc/libxml228 --with-mhash=/ueidc/mhash099 --with-curl=/ueidc/curl7531 --with-gd=/ueidc/gd210 --with-mcrypt=/ueidc/libmcrypt257 --with-freetype-dir=/ueidc/freetype254 -with-iconv-dir=/ueidc/libiconv115

『捌』 在編譯 php 時,為了使用 php 內置的 fpm 功能,應該使用什麼參數

php5.3.3以後源碼中已經內嵌了php-fpm,不用象以前的php版本一樣專門打補丁了,只需要在configure的時候添加編譯參數即可。關於php-fpm的編譯參數有–enable-fpm–with-fpm-user=www–with-fpm-group=www–with-libevent-dir=libevent位置。但是,php5.3.3以後的php-fpm不再支持php-fpm以前具有的/usr/local/php/sbin/php-fpm(start|stop|reload)等命令,需要使用信號控制:master進程可以理解以下信號:INT,TERM立刻終止QUIT平滑終止USR1重新打開日誌文件USR2平滑重載所有worker進程並重新載入配置和二進制模塊有了以上信號,php-fpm進程重啟就方便多了。例子:php-fpm關閉:代碼示例:kill-INT`cat/usr/local/php/var/run/php-fpm.pid`php-fpm重啟:代碼示例:kill-USR2`cat/usr/local/php/var/run/php-fpm.pid`說明:cat部分是php-fpm的進程號,可能是我用的5.4的問題。沒有用php-fpm.pid,就沒有這個文件。可以用psaux|grepphp-fpm,使用第一個進程的進程號,測試可行。

『玖』 編譯安裝php時怎麼使用源碼安裝的參數

1、Linux下,默認是在/usr/local/bin/,假如你設置--prefix=/usr/local/php那麼就在/usr/local/php/bin/ 2、sbin道理相同。sbin的意思就是server bin 3、EPREFIX沒用過 4、如果要用2套版本,用prefix區分開不同的安裝目錄。

『拾』 PHP編譯時需要同時支持gd jpeg freetype什麼意思

gd庫:一個圖片處理的php內置
既然你知道編譯php那麼什麼是依賴我就不說了,如果你不用php自帶的gd庫,那麼--without-gd
同樣的,如果你要編譯時帶了參數--with-gd那麼,就老老實實的裝jpeg,libpng和freetype吧
最好加上:
--enable-gd-native-ttf
這個參數,允許gd中使用自定義字體

閱讀全文

與編譯php時的參數相關的資料

熱點內容
編程老師的照片牆 瀏覽:299
函數未定義但是能編譯運行 瀏覽:974
湖南省常德通用壓縮機有限公司 瀏覽:109
伺服器的雙電是什麼意思 瀏覽:614
程序員離開後代碼運行幾天 瀏覽:386
多多樂app是什麼幹嘛的 瀏覽:346
文檔加密授權工具 瀏覽:436
命令與征服將軍閃退 瀏覽:132
vs2019預編譯怎麼設置 瀏覽:780
沈陽中軟python培訓班 瀏覽:493
逆戰文件夾怎麼放 瀏覽:120
怎麼統一刪除文件夾raw文件 瀏覽:121
卡爾曼濾波演算法書籍 瀏覽:769
安卓手機怎麼用愛思助手傳文件進蘋果手機上 瀏覽:844
安卓怎麼下載60秒生存 瀏覽:803
外向式文件夾 瀏覽:240
dospdf 瀏覽:431
怎麼修改騰訊雲伺服器ip 瀏覽:392
pdftoeps 瀏覽:496
為什麼鴻蒙那麼像安卓 瀏覽:736