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); $ memnewMemcache; $ mem-& gt; connect (& quot; 127.0.0.1 & quot;, 11211 ); $ re $ mem-& g no error is returned when I run the script in PHP under the command line, but an error is returned when I output the script 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.