I'm trying to get started with a simple LAMP site, but can't seem to get the Zend structure for my local Apache instance. I started working with XAMPP on Windows and since then I tried the Centos 6 virtual machine with manual installation of Apache / PHP, but still got the same error as the one below. Phpinfo () works just fine, like the rest of the site.
Fatal error: Class 'Zend\Log\Logger' not found in /var/www/html/site/public/test.php on line 20
My website code is a pretty simple test to call the Zend frame logger, which looks like this
use Zend\Log\Logger;
use Zend\Log\Writer;
echo "<p>Hello world</p>";
echo $_POST["VIN"];
phpinfo();
$logger = new Zend\Log\Logger;
$writter = new Zend\Log\Writer\Stream('php://output');
$logger->addWriter($writer);
?>
My Apache linux httpd.conf
<VirtualHost *:80>
DocumentRoot /var/www/html/site/public
<Directory /var/www/html/site/public>
DirectoryIndex test.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
The structure of my Zend is in / var / www / html / site / library / Zend, and I added / var / www / html / site / library in php.ini as well.
source
share