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.