Php

在 CentOS7 上編譯 PHP7 時變數名無效:`–with-jpeg-dir'

  • January 5, 2016

我正在嘗試配置 PHP7,即使./configure --help變數名稱為--with-jpeg-dir. 我錯過了什麼?這是我的命令:

./configure --with-apxs2=/usr/bin/apxs --with-mysqli --with-imap --with-imap-ssl --with-kerberos -- with-pdo-mysql --with-openssl --with-curl --enable-pcntl libdir=lib64 --with-zlib --enable-zip --enable-mbstring --enable-intl --with-readline --with-xsl --with-gd --with-jpeg-dir=/usr/lib64 --with-png-dir=/usr/lib64 --with-gmp --enable-bcmath --enable-opcache --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d

確切的錯誤響應是: configure: error: invalid variable name: '--with-jpeg-dir'

您的配置中似乎有一些錯字:

– with-pdo-mysql 帶空格,libdir=lib64 不帶雙連字元 –

這應該有效:

./configure --with-apxs2=/usr/bin/apxs --with-mysqli --with-imap --with-imap-ssl --with-kerberos --with-pdo-mysql --with-openssl --with-curl --enable-pcntl --libdir=lib64 --with-zlib --enable-zip --enable-mbstring --enable-intl --with-readline --with-xsl --with-gd --with-jpeg-dir=/usr/lib64 --with-png-dir=/usr/lib64 --with-gmp --enable-bcmath --enable-opcache --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d

還要確保所有軟體包都已安裝,並且這些路徑實際上是正確的。

引用自:https://serverfault.com/questions/746879