#解压文件,并进行到目录 # tar -xjf php-json-ext-1.2.1.tar.bz2 #进入当前路径,并使用当前系统phpize刷新configure文件 # cd php-json-ext-1.2.1 # phpize Configuring for: PHP Api Version: 20041225 Zend Module Api No: 20050922 Zend Extension Api No: 220051025 #可以看到以configure等文件已经刷新到当前的时间了. # ll total 1468 -rw-r--r-- 1 10008 10008 66540 Jun 18 12:13 acinclude.m4 -rw-rw-r-- 1 10008 10008 298049 Jun 18 12:13 aclocal.m4 drwxr-xr-x 2 root root 4096 Jun 18 12:13 autom4te.cache drwxrwxr-x 2 10008 10008 4096 Jun 18 12:13 build -rwxr-xr-x 1 10008 10008 42037 Jun 18 12:13 config.guess -rw-rw-r-- 1 10008 10008 1610 Mar 31 2006 config.h.in -rw-rw-r-- 1 10008 10008 2139 Jan 31 2006 config.m4 -rwxr-xr-x 1 10008 10008 30253 Jun 18 12:13 config.sub -rwxrwxr-x 1 10008 10008 658032 Jun 18 12:13 configure #进行默认当前路径编译,可以看到会生成一个我们需要的模块 # ./configure # make Libraries have been installed in: /root/php-json-ext-1.2.1/modules If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the `-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the `LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the `LD_RUN_PATH' environment variable during linking - use the `-Wl,--rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to `/etc/ld.so.conf' See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- Build complete. (It is safe to ignore warnings about tempnam and tmpnam). #由此我们可以知道,其实YUM安装的LAMP创建的模块放置在/usr/lib64/php/modules/,上面的configure记录也不太可靠. # make install Installing shared extensions: /usr/lib64/php/modules/ # ll /usr/lib64/php/modules/json.so -rwxr-xr-x 1 root root 92750 Jun 18 12:14 /usr/lib64/php/modules/json.so |