PHP Configure

PHP Configure

一碧聪、
./configure --prefix=/usr/local/php7.0.8 --with-mcrypt=/usr/local/lib/ --with-curl --with-freetype-dir --with-gd --with-gettext --with-iconv-dir --with-kerberos --with-libdir=lib64 --with-libxml-dir --with-mysqli --with-openssl --with-pcre-regex --with-pdo-mysql --with-pdo-sqlite --with-pear --with-png-dir --with-xmlrpc --with-xsl --with-zlib --enable-fpm --enable-bcmath --enable-libxml --enable-inline-optimization --enable-gd-native-ttf --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-xml --enable-zip --enable-cli —disable-posix-threads

'./configure' '--prefix=/usr/local/php7.0.8' '--with-curl' '--with-freetype-dir' '--with-gd' '--with-gettext' '--with-iconv-dir' '--with-kerberos' '--with-libdir=lib64' '--with-libxml-dir' '--with-mysqli' '--with-openssl' '--with-pcre-regex' '--with-pdo-mysql' '--with-pdo-sqlite' '--with-pear' '--with-png-dir' '--with-xmlrpc' '--with-xsl' '--with-zlib' '--enable-fpm' '--enable-bcmath' '--enable-libxml' '--enable-inline-optimization' '--enable-gd-native-ttf' '--enable-mbregex' '--enable-mbstring' '--enable-opcache' '--enable-pcntl' '--enable-shmop' '--enable-soap' '--enable-sockets' '--enable-sysvsem' '--enable-xml' '--enable-zip' '--enable-cli' '--with-mcrypt'

sudo yum install libmcrypt-devel

sudo make clean
sudo make & make install

sudo make & make install 報(bào)錯(cuò)

/bin/ld: ext/phar/.libs/util.o: undefined reference to symbol 'EVP_DigestInit@@libcrypto.so.10'
/bin/ld: note: 'EVP_DigestInit@@libcrypto.so.10' is defined in DSO /lib64/libcrypto.so.10 so try adding it to the linker command line
/lib64/libcrypto.so.10: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1

使用 RepoForge

#1 查看 CPU architecture
uname -i

2 我的服務(wù)器芯片結(jié)構(gòu)是 x86_64,我直接使用 wget 下載 rpm 安裝包

wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm

Download the rpmforge-release package. Choose one of the two links below, selecting to match your host's architecture. If you are unsure of which one to use you can check your architecture with the command uname -i
i686 http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i686.rpm
x86_64 http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm

The preferred rpmforge-release package to retrieve and to install in order to enable that repository is one of the two listed above.

Install DAG's GPG key
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt

If you get an error message like the following the key has already been imported:
error: http://apt.sw.be/RPM-GPG-KEY.dag.txt: key 1 import failed.

Verify the package you have downloaded
rpm -K rpmforge-release-0.5.3-1.el6.rf.*.rpm

Security warning: The rpmforge-release package imports GPG keys into your RPM database. As long as you have verified the md5sum of the key injection package, and trust Dag, et al., then it should be as safe as your trust of them extends.

Install the package
rpm -i rpmforge-release-0.5.3-1.el6.rf.*.rpm

This will add a yum repository config file and import the appropriate GPG keys.

Then try to install something like this
yum install htop

Makefile 內(nèi)容
srcdir = /home/james/php-7.0.8
builddir = /home/james/php-7.0.8
top_srcdir = /home/james/php-7.0.8
top_builddir = /home/james/php-7.0.8
EGREP = /usr/bin/grep -E
SED = /usr/bin/sed
CONFIGURE_COMMAND = './configure' '--prefix=/usr/local/php7.0.8' '--with-curl' '--with-freetype-dir' '--with-gd' '--with-gettext' '--with-iconv-dir' '--with-kerberos' '--with-libdir=lib64' '--with-libxml-dir' '--with-mysqli' '--with-openssl' '--with-pcre-regex' '--with-pdo-mysql' '--with-pdo-sqlite' '--with-pear' '--with-png-dir' '--with-xmlrpc' '--with-xsl' '--with-zlib' '--enable-fpm' '--enable-bcmath' '--enable-libxml' '--enable-inline-optimization' '--enable-gd-native-ttf' '--enable-mbregex' '--enable-mbstring' '--enable-opcache' '--enable-pcntl' '--enable-shmop' '--enable-soap' '--enable-sockets' '--enable-sysvsem' '--enable-xml' '--enable-zip' '--enable-cli' '--with-mcrypt'
CONFIGURE_OPTIONS = '--prefix=/usr/local/php7.0.8' '--with-curl' '--with-freetype-dir' '--with-gd' '--with-gettext' '--with-iconv-dir' '--with-kerberos' '--with-libdir=lib64' '--with-libxml-dir' '--with-mysqli' '--with-openssl' '--with-pcre-regex' '--with-pdo-mysql' '--with-pdo-sqlite' '--with-pear' '--with-png-dir' '--with-xmlrpc' '--with-xsl' '--with-zlib' '--enable-fpm' '--enable-bcmath' '--enable-libxml' '--enable-inline-optimization' '--enable-gd-native-ttf' '--enable-mbregex' '--enable-mbstring' '--enable-opcache' '--enable-pcntl' '--enable-shmop' '--enable-soap' '--enable-sockets' '--enable-sysvsem' '--enable-xml' '--enable-zip' '--enable-cli' '--with-mcrypt'
PHP_MAJOR_VERSION = 7
PHP_MINOR_VERSION = 0
PHP_RELEASE_VERSION = 8
PHP_EXTRA_VERSION =
AWK = gawk
YACC = exit 0;
RE2C = exit 0;
RE2C_FLAGS =
SHLIB_SUFFIX_NAME = so
SHLIB_DL_SUFFIX_NAME = so
PHP_CLI_OBJS = sapi/cli/php_cli.lo sapi/cli/php_http_parser.lo sapi/cli/php_cli_server.lo sapi/cli/ps_title.lo sapi/cli/php_cli_process_title.lo
PHP_EXECUTABLE = $(top_builddir)/$(SAPI_CLI_PATH)
SAPI_CLI_PATH = sapi/cli/php
BUILD_CLI = $(LIBTOOL) --mode=link $(CC) -export-dynamic $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(EXTRA_LDFLAGS_PROGRAM) $(LDFLAGS) $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_BINARY_OBJS) $(PHP_CLI_OBJS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $(SAPI_CLI_PATH)
php_fpm_systemd = simple
php_fpm_user = nobody
php_fpm_group = nobody
php_fpm_sysconfdir = /usr/local/php7.0.8/etc
php_fpm_localstatedir = /usr/local/php7.0.8/var
php_fpm_prefix = /usr/local/php7.0.8

homebrew#

'./configure' '--prefix=/usr/local/Cellar/php70/7.0.7' '--localstatedir=/usr/local/var' '--sysconfdir=/usr/local/etc/php/7.0' '--with-config-file-path=/usr/local/etc/php/7.0' '--with-config-file-scan-dir=/usr/local/etc/php/7.0/conf.d' '--mandir=/usr/local/Cellar/php70/7.0.7/share/man' '--enable-bcmath' '--enable-calendar' '--enable-dba' '--enable-exif' '--enable-ftp' '--enable-gd-native-ttf' '--enable-mbregex' '--enable-mbstring' '--enable-shmop' '--enable-soap' '--enable-sockets' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--enable-wddx' '--enable-zip' '--with-freetype-dir=/usr/local/opt/freetype' '--with-gd' '--with-gettext=/usr/local/opt/gettext' '--with-iconv-dir=/usr' '--with-icu-dir=/usr/local/opt/icu4c' '--with-jpeg-dir=/usr/local/opt/jpeg' '--with-kerberos=/usr' '--with-libedit' '--with-mhash' '--with-ndbm=/usr' '--with-png-dir=/usr/local/opt/libpng' '--with-xmlrpc' '--with-zlib=/usr' '--with-readline=/usr/local/opt/readline' '--without-gmp' '--without-snmp' '--with-libxml-dir=/usr/local/opt/libxml2' '--with-pdo-odbc=unixODBC,/usr/local/opt/unixodbc' '--with-unixODBC=/usr/local/opt/unixodbc' '--with-apxs2=/usr/sbin/apxs' '--libexecdir=/usr/local/Cellar/php70/7.0.7/libexec' '--with-bz2=/usr' '--disable-debug' '--with-openssl=/usr/local/opt/openssl' '--enable-fpm' '--with-fpm-user=_www' '--with-fpm-group=_www' '--with-curl' '--with-xsl=/usr' '--with-ldap' '--with-ldap-sasl=/usr' '--with-mysql-sock=/tmp/mysql.sock' '--with-mysqli=mysqlnd' '--with-mysql=mysqlnd' '--with-pdo-mysql=mysqlnd' '--disable-opcache' '--enable-pcntl' '--without-pear' '--enable-dtrace' '--disable-phpdbg' '--enable-zend-signals' 'CC=clang' 'CXX=clang++'

二枕赵、
cat /proc/meminfo
cat /proc/cpuinfo

less /proc/cpuinfo OR lscpu

Linux show free and used memory in the system

cat /proc/meminfo

free

free -m

free -mt

free -gt

See used and free memory and cpu usage and more

top

htop(command not found)

atop(command not found)

Linux find out the current running kernel version

cat /proc/version

Linux version 3.10.0-327.22.2.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC) ) #1 SMP Thu Jun 23 17:05:11 UTC 2016

cat /etc/*-release

CentOS Linux release 7.2.1511 (Core)
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

CentOS Linux release 7.2.1511 (Core)
CentOS Linux release 7.2.1511 (Core)

Display installed hard disk and size

fdisk -l | grep ‘^Disk /dev/’

uname -a

name -mrs

PHP 編譯安裝
./configure --prefix=/usr/local/php7.0.8 --with-curl --with-freetype-dir --with-gd --with-gettext --with-iconv-dir --with-kerberos --with-libdir=lib64 --with-libxml-dir --with-mysqli --with-openssl --with-pcre-regex --with-pdo-mysql --with-pdo-sqlite --with-pear --with-png-dir --with-xmlrpc --with-xsl --with-zlib --enable-fpm --enable-bcmath --enable-libxml --enable-inline-optimization --enable-gd-native-ttf --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-xml --enable-zip
582 2016-06-30 11:23:03 ./configure --prefix=/usr/local/php7.0.8 --with-curl --with-freetype-dir --with-gd --with-gettext --with-iconv-dir --with-kerberos --with-libdir=lib64 --with-libxml-dir --with-mysqli --with-openssl --with-pcre-regex --with-pdo-mysql --with-pdo-sqlite --with-pear --with-png-dir --with-xmlrpc --with-xsl --with-zlib --enable-fpm --enable-bcmath --enable-libxml --enable-inline-optimization --enable-gd-native-ttf --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-xml --enable-zip
584 2016-06-30 11:27:24 ./configure --prefix=/usr/local/php7.0.8 --with-curl --with-freetype-dir --with-gd --with-gettext --with-iconv-dir --with-kerberos --with-libdir=lib64 --with-libxml-dir --with-mysqli --with-openssl --with-pcre-regex --with-pdo-mysql --with-pdo-sqlite --with-pear --with-png-dir --with-xmlrpc --with-xsl --with-zlib --enable-fpm --enable-bcmath --enable-libxml --enable-inline-optimization --enable-gd-native-ttf --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-xml --enable-zip
586 2016-06-30 11:29:55 ./configure --prefix=/usr/local/php7.0.8 --with-curl --with-freetype-dir --with-gd --with-gettext --with-iconv-dir --with-kerberos --with-libdir=lib64 --with-libxml-dir --with-mysqli --with-openssl --with-pcre-regex --with-pdo-mysql --with-pdo-sqlite --with-pear --with-png-dir --with-xmlrpc --with-xsl --with-zlib --enable-fpm --enable-bcmath --enable-libxml --enable-inline-optimization --enable-gd-native-ttf --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-xml --enable-zip
588 2016-06-30 11:31:47 ./configure --prefix=/usr/local/php7.0.8 --with-curl --with-freetype-dir --with-gd --with-gettext --with-iconv-dir --with-kerberos --with-libdir=lib64 --with-libxml-dir --with-mysqli --with-openssl --with-pcre-regex --with-pdo-mysql --with-pdo-sqlite --with-pear --with-png-dir --with-xmlrpc --with-xsl --with-zlib --enable-fpm --enable-bcmath --enable-libxml --enable-inline-optimization --enable-gd-native-ttf --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-xml --enable-zip
590 2016-06-30 11:32:45 ./configure --prefix=/usr/local/php7.0.8 --with-curl --with-freetype-dir --with-gd --with-gettext --with-iconv-dir --with-kerberos --with-libdir=lib64 --with-libxml-dir --with-mysqli --with-openssl --with-pcre-regex --with-pdo-mysql --with-pdo-sqlite --with-pear --with-png-dir --with-xmlrpc --with-xsl --with-zlib --enable-fpm --enable-bcmath --enable-libxml --enable-inline-optimization --enable-gd-native-ttf --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-xml --enable-zip —enable-cli

三床绪、PHP CLI

The CLI SAPI is enable by default using —enable-cli, but may be disabled using the —disable-cli option when running ./configure.

The name, location and existence of the CLI/CGI binaries will differ depending on how PHP is installed on your system. By default when executing make, both the CGI and CLI are built and placed as sapi/cgi/php-cgi and sapi/cli/php respectively, in your PHP source directory. You will note that both are name php. What happens during make install depends on your configure line. If a module SAPI is chosen during configure, such as apes, or the —disable-cgi option is used, the CLI is copied to {PREFIX}/bin/php during make install otherwise the CGI is placed there. So, for example, if —with-apes is in your configure line then the CLI is copied to {PREFIX}/bin/php during make install. If you want to override the installation of the CGI binary, use

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === 'e115a8dc7871f15d853148a7fbac7da27d6c0030b848d9b3dc09e2a0388afed865e6a3d6b3c0fad45c48e2b5fc1196ae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末渣蜗,一起剝皮案震驚了整個(gè)濱河市,隨后出現(xiàn)的幾起案子棺耍,更是在濱河造成了極大的恐慌,老刑警劉巖种樱,帶你破解...
    沈念sama閱讀 216,496評論 6 501
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件蒙袍,死亡現(xiàn)場離奇詭異,居然都是意外死亡嫩挤,警方通過查閱死者的電腦和手機(jī)害幅,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,407評論 3 392
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來岂昭,“玉大人以现,你說我怎么就攤上這事≡及。” “怎么了邑遏?”我有些...
    開封第一講書人閱讀 162,632評論 0 353
  • 文/不壞的土叔 我叫張陵,是天一觀的道長恰矩。 經(jīng)常有香客問我记盒,道長,這世上最難降的妖魔是什么外傅? 我笑而不...
    開封第一講書人閱讀 58,180評論 1 292
  • 正文 為了忘掉前任纪吮,我火速辦了婚禮,結(jié)果婚禮上萎胰,老公的妹妹穿的比我還像新娘碾盟。我一直安慰自己,他們只是感情好技竟,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,198評論 6 388
  • 文/花漫 我一把揭開白布冰肴。 她就那樣靜靜地躺著,像睡著了一般。 火紅的嫁衣襯著肌膚如雪嚼沿。 梳的紋絲不亂的頭發(fā)上估盘,一...
    開封第一講書人閱讀 51,165評論 1 299
  • 那天,我揣著相機(jī)與錄音骡尽,去河邊找鬼遣妥。 笑死,一個(gè)胖子當(dāng)著我的面吹牛攀细,可吹牛的內(nèi)容都是我干的箫踩。 我是一名探鬼主播,決...
    沈念sama閱讀 40,052評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼谭贪,長吁一口氣:“原來是場噩夢啊……” “哼境钟!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起俭识,我...
    開封第一講書人閱讀 38,910評論 0 274
  • 序言:老撾萬榮一對情侶失蹤慨削,失蹤者是張志新(化名)和其女友劉穎,沒想到半個(gè)月后套媚,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體缚态,經(jīng)...
    沈念sama閱讀 45,324評論 1 310
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,542評論 2 332
  • 正文 我和宋清朗相戀三年堤瘤,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了玫芦。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 39,711評論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡本辐,死狀恐怖桥帆,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情慎皱,我是刑警寧澤老虫,帶...
    沈念sama閱讀 35,424評論 5 343
  • 正文 年R本政府宣布,位于F島的核電站茫多,受9級特大地震影響祈匙,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜地梨,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,017評論 3 326
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望缔恳。 院中可真熱鬧宝剖,春花似錦、人聲如沸歉甚。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,668評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至赖钞,卻和暖如春腰素,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背雪营。 一陣腳步聲響...
    開封第一講書人閱讀 32,823評論 1 269
  • 我被黑心中介騙來泰國打工弓千, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人献起。 一個(gè)月前我還...
    沈念sama閱讀 47,722評論 2 368
  • 正文 我出身青樓洋访,卻偏偏與公主長得像,于是被迫代替她去往敵國和親谴餐。 傳聞我的和親對象是個(gè)殘疾皇子姻政,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,611評論 2 353

推薦閱讀更多精彩內(nèi)容