Reputation: 439
Hi guys i am new to Zend framework and today only i have started learning it.so my first step is i am installing ZF1 in my system so i have done the steps which is need for install from below link https://framework.zend.com/manual/1.12/en/learning.quickstart.create-project.html
And when i run http://localhost/quickstart/
it is showing index of those files it is not running index.php file
can any one help me what mistake i have done and i am using the ubuntu server
below are the things which i had followed i had downloaded it downlaoded two zip files one is zendAuth and another one is and zend framework 1.12.20 and i have create one folder names quickstart and and i have moved those files to to inside quickstart.
So now my files are in under the /var/www/quickstart/zendAuth/Zemdframeowrk 1.12.20
And i have made php.ini
change in /etc/php/7.2/apache2/php.ini
and in that i have made include_path = ".:/var/www/quickstart/zendAuth/library"
and after that in apache2.conf
file at the end of file i have added the below code
<VirtualHost *:80>
DocumentRoot "/var/www"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
ServerName quickstart.local
DocumentRoot /var/www/html/quickstart/zendAuth/public
SetEnv APPLICATION_ENV "development"
<Directory /var/www/html/quickstart/zendAuth/public>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
And in hosts file at the top of the file i have added this `127.0.0.1 quickstart.local`
Can any one check and let me where i have done mistake and please help me out.
Thanks in advance.
Upvotes: 0
Views: 176
Reputation: 401
You can try below configuration and then set .htaccess for root and public folder:
1) Entry in hosts file as below
127.0.0.1 quickstart.local
2) Set virtual host in httpd-vhosts.conf as below
<VirtualHost *:80>
ServerName quickstart.local
DocumentRoot "/var/www/html/quickstart/zendAuth/public"
ServerAlias quickstart.local
<Directory "/var/www/html/quickstart/zendAuth/public">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
3) Check root htaccess as below
SetEnv APPLICATION_ENV development
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* index.php [L]
IndexIgnore *
Options -Indexes
4) Check htacess in public folder as below
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+?)/$ /$1 [R=302,NE,L]
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [L]
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
RewriteRule ^(.*)$ %{ENV:BASE}/index.php [L]
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
Upvotes: 4