In the command line, I run the script in PHP, but the error is returned when I output the script on the webpage.

Source: Internet
Author: User
In the command line, I use PHP to execute the script without reporting an error, but I output the error PHPcode & lt ;? Phperror_reporting (E_ERROR | E_WARNING | E_PARSE); $ mem = newMemcache; $ mem-& gt; conne no error is returned when I use PHP to execute scripts under the command line, however, an error is reported when I output data on the webpage.
PHP code
  

  Connect ("127.0.0.1", 11211); $ re = $ mem-> set ('testkey1', 'This is first value', 0, 60); var_export ($ re ); $ val = $ mem-> get ('testkey1'); echo "\ r \ n"; echo "Get key1 value :". $ val. "\ r \ n ";

The above is my code
I use php index. php to execute scripts and get the correct results.
However, when I enter http: // site/index. php in the browser, the system prompts "Class 'memcache' not found in"

I have installed all memcached and restarted php and nginx.

Why does an error occur on the webpage ?? Why ??

------ Solution --------------------
The php. ini configuration file loaded in two ways is different.
Check the phpinfo and command line php -- ini on the web page to see if they are different.
------ Solution --------------------
Or in php. ini, the configured extension uses the relative address, extension_dir, and some other relative addresses may also go wrong.

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.