#解壓文件,并進行到目錄 # 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 |