Learn to use simple PHP

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.