Home >Backend Development >PHP Tutorial >各位大神 求解决 Linux 下 LAMP 环境搭建 扩展编译
linux : Ubuntu 14.04
PHP : 5.5
安装 php已经成功安装并且可以phpinfo()输出信息,但是在编译安装PDO_MYSQL出现错误 (编译其他的扩展是也出现同样的问题)在生成configure 时我用的命令是:sudo /usr/local/php/bin/phpize
这一步是系统输出是
Configuring for:
PHP Api Version: 20121113
Zend Module Api No: 20121212
Zend Extension Api No: 220121212
然后我执行编译命令:
sudo ./configure --with-php-config = /usr/local/php/bin/php-config --with-pdo_mysql
这里的php-config 文件路径是对的 我保证
然后系统输出下列信息有点多 我标记错误信息:
./configure: line 1290: =: command not found
export COLORTERM="gnome-terminal"
export CONFIG_SHELL="/bin/bash"
export DISPLAY=":0"
export DUALCASE="1"
export HOME="/home/prg"
export LANG="en_US.UTF-8"
export LANGUAGE="C"
export LC_ADDRESS="zh_CN.UTF-8"
export LC_ALL="C"
export LC_IDENTIFICATION="zh_CN.UTF-8"
export LC_MEASUREMENT="zh_CN.UTF-8"
export LC_MONETARY="zh_CN.UTF-8"
export LC_NAME="zh_CN.UTF-8"
export LC_NUMERIC="zh_CN.UTF-8"
export LC_PAPER="zh_CN.UTF-8"
export LC_TELEPHONE="zh_CN.UTF-8"
export LC_TIME="zh_CN.UTF-8"
export LOGNAME="root"
export LS_COLORS="rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:"
export OLDPWD
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
export PWD="/home/prg/PHP/php-5.5.10/ext/pdo_mysql"
export SHELL="/bin/bash"
export SHLVL="1"
export SUDO_COMMAND="./configure --with-php-config = /usr/local/php/bin/php-config --with-pdo_mysql"
export SUDO_GID="1000"
export SUDO_UID="1000"
export SUDO_USER="prg"
export TERM="xterm"
export USER="root"
export USERNAME="root"
export XAUTHORITY="/var/run/gdm/auth-for-prg-NbD87m/database"
export as_nl="
"
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: /usr/local/php/bin/php-config
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for /usr/local/php/bin/php-config-cc... no
checking for /usr/local/php/bin/php-config-gcc... no
checking for cc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... /usr/local/php/bin/php-config
configure: error: invalid value of canonical build
到最后直接停止编译了 google baidu了半天 不知怎么解决 求助 因为linux真机 还不知道怎么截图什么的 希望把问题描述清楚了,谢谢各位大神了
建议使用apt-get install 方式来自动安装.没必要自己编译.
没人在Ubuntu 下源码安装过??。。
奇怪 ,今天重新开机就可以咯 哈哈 呵呵
重新开机可以估计是有依赖的库更新了。