ホームページ  >  記事  >  バックエンド開発  >  php 5.2.17をcentosにインストールするとmysql_connect、json_encode等の機能が使えなくなる問題の解決方法

php 5.2.17をcentosにインストールするとmysql_connect、json_encode等の機能が使えなくなる問題の解決方法

WBOY
WBOYオリジナル
2016-06-13 13:34:091052ブラウズ

yum を使用して centos に php 5.2.17 をインストールします。Mysql_connect、json_encode などの機能は使用できません
centos システムの元の php バージョンは 5.1.6 です。しかし、Configure コマンドラインには次のように表示されます。

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
'./configure' '--build=i686-redhat-linux-gnu' '--host=i686-redhat-linux-gnu' 
'--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' 
'--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' 
'--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' 
'--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' 
'--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' 
'--with-libdir=lib' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' 
'--with-pic' '--disable-rpath' '--without-pear' '--with-bz2' '--with-exec-dir=/usr/bin' 
'--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-xpm-dir=/usr' 
'--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' 
'--with-jpeg-dir=/usr' '--with-openssl' '--with-pcre-regex=/usr' '--with-zlib' 
'--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' 
'--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' 
'--enable-sysvmsg' '--with-kerberos' '--enable-ucd-snmp-hack' 
'--enable-shmop' '--enable-calendar' '--without-mime-magic' 
'--without-sqlite' '--with-libxml-dir=/usr' '--enable-xml' 
'--with-system-tzdata' '--with-apxs2=/usr/sbin/apxs' '<SPAN style="COLOR: #e53333">--without-mysql</SPAN>' 
'--without-gd' '--disable-dom' '--disable-dba' 
'--without-unixODBC' '--disable-pdo' '--disable-xmlreader' 
'--disable-xmlwriter' '<SPAN style="COLOR: #e53333">--disable-json</SPAN>' '--without-pspell' 
'--disable-wddx' '--without-curl' '--disable-posix' 
'--disable-sysvmsg' '--disable-sysvshm' '--disable-sysvsem' 


--without-mysql

--disable-json
上記のように、mysql と json の両方が無効になっています。どうすれば変更できますか。これは、オプションで通常通り json と mysql を使用できます。ありがとうございます。



-----解決策---------
おそらく、json mysql は yum に含まれていません

ソース コード パッケージを自分でダウンロードしてください
たとえば、json
http://www.aurore.net/projects/php-json/php-json- ext- 1.2.1.tar.bz2
次に、

を解凍し、
#phpize
#./configure (詳細については README を参照してください)
#make
#make

をインストールして自分でコンパイルし、
extension=xxx.so を php.ini に追加します

Apache を再起動します...
声明:
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
前の記事:Smarty を使用して