Under the command line little brother I use PHP to execute the script does not error, but the younger brother I output on the page on the error

Source: Internet
Author: User
At the command line I use PHP to execute the script does not error, but I output on the page on the error
PHP Code
  
  
  
  Connect ("127.0.0.1", 11211), $re = $mem->set (' testkey1 ', ' This is first value ', 0, $); Var_export ($re); $val = $mem Get (' testkey1 '); echo "\ r \ n"; echo "Get Key1 Value:". $val. "\ r \ n";

The above is my code.
I can execute scripts with PHP index.php and get the correct results.
But I'm typing http://site/index.php in the browser to suggest "Class ' Memcache ' not found in"

My memcached are loaded, and I've restarted PHP and Nginx.

Why is there an error on the page?? Why is this??

------Solution--------------------
2 modes of execution are caused by different php.ini configuration files loaded.
Page view phpinfo and command line PHP--ini to see if it is different.
------Solution--------------------
Or php.ini, the configured extension uses a relative address, extension_dir this, and some other relative addresses also make mistakes.
  • Related Article

    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.