php5.4-Developing PHP third-party extensions. executed under the browser. Error cannot be found with php command execution

Source: Internet
Author: User
Test the added PHP extension class Library

Everything works when you use your browser to test your methods.

However, the PHP xx.php under Linux is executed with an error.

As follows

[Root@node234 test]# php size.php
PHP Fatal error:call to undefined function size () in/var/www/html/test/size.php on line 3

Reply content:

Test the added PHP extension class Library

Everything works when you use your browser to test your methods.

However, the PHP xx.php under Linux is executed with an error.

As follows

[Root@node234 test]# php size.php
PHP Fatal error:call to undefined function size () in/var/www/html/test/size.php on line 3

Another possibility is that your CLI and CGI php are not loading the same php.ini file, you just loaded your extension into CGI

That's what Chris Yue is talking about, and you can look at the specific differences in the following ways

Execute the $ php-m to see if there is no extension you have written, and from your point of view there is no.
Execute again under $ php-i | grep INI to see which php.ini file is loaded.
At the same time, the Web page performs a

I think it's your CGI PHP and CLI PHP is not the same PHP, it is recommended that you use Phpinfo (); and php-i to see if the extension was installed successfully.
Or check your CLI's PHP path.

  • 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.