I am using Apache version 2.4.18 and PHP 7. I am trying to run my zf2 application locally but when I go to url localhost/zf2-app-folder/public
it is showing me the content of index.php
but it should execute the index file. Then I created vhost by editing /etc/apache2/sites-enables/000-default.conf
. The configuration is as follows:
<VirtualHost *:80>
ServerName myServerName
DocumentRoot /var/www/app-folder/public
<Directory /var/www/app-folder/public>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
and then I created the entry of myServerName
in the hosts file but it is also showing me same index.php
content.
I need to install sudo apt-get intsall libapache2-mod-php and then run a2enmod php7.0. Don't forgot to restart apache
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.