Configuration files in:/etc/php5/$, different modes contain their own php.ini profiles. PHP can run in a variety of modes: CGI, fastcgi, CLI, Web module mode, such as 4 kinds;
The mode I'm using now is the CLI mode, where we do a test.
Installation of sudo apt-get install Php5-dev is required under Ubuntu
PHP should be a link to php5.
To modify the Config.m4 file:
my.php File Contents:
<?PHP$BR= (Php_sapi_name() = = "CLI")? "": "<br>";if(!extension_loaded(' My ')) { DL(' My. ').php_shlib_suffix);}$module= ' my ';$functions=Get_extension_funcs($module);Echo"Functions available in the test extension:$BR\ n ";foreach($functions as $func) { Echo $func."$BR\ n ";}Echo"$BR\ n ";$function= ' confirm_ '.$module. ' _compiled ';if(extension_loaded($module)) { $str=$function($module);} Else { $str= "Module$moduleIs isn't compiled into PHP ";}Echo"$str\ n ";?>
my_test.php File Contents:
<? PHP echo confirm_my_compiled (' Testmerlin ');? >
Edit the/etc/php5/cli/php.ini file and add a line:
Test:
[Email protected]:~/swinstall/php-5.6. 4/ext/my$ php my_test.php Congratulations! You have successfully modified EXT/MY/CONFIG.M4. Module Testmerlin is now compiled to PHP.
[Email protected]:~/swinstall/php-5.6. 4/ext/my$
Learn to use simple PHP