Php5.4-develop a PHP third-party extension. Execute it in the browser. The error cannot be found if you execute the PHP Command.

Source: Internet
Author: User
The added PHP extension class library is normal when you use a browser for Method Testing. however, phpxx in Linux is used. an error is reported during php Execution. [root @ node234test] # phpsize. phpPHPFatalerror: Calltoundefinedfunctionsize () I... test the added PHP extension class library

Everything works normally when you use a browser for Method Testing.

However, an error is reported when php xx. php is executed in Linux.

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 normally when you use a browser for Method Testing.

However, an error is reported when php xx. php is executed in Linux.

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 load are not the same php. ini file. You only load your extension to cgi.

It is what Chris Yue said. You can use the following method to see the specific difference:

Run $ php-m to see if there are any extensions you have written. From your perspective, there is no such extension.
Run $ php-I | grep ini to check which php. ini file is loaded.
Execute

I think your cgi php and cli php are not the same php. We suggest you use phpinfo (); and php-I to check whether all the extensions have been installed successfully.
Or check the php path of your cli.

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.