[Solved] Set up zend project in live server [closed]


One solution is documented in Zend Framework on a shared host

Essentially, you need an index.php and a .htaccess file in the root folder as that’s where Apache is serving from.

index.php:

<?php 
define('RUNNING_FROM_ROOT', true);
include 'public/index.php';

.htaccess:

SetEnv APPLICATION_ENV production

RewriteEngine On
RewriteRule .* index.php

You’ll also need to sort out the paths to static assets like CSS and JS files. You can either change the paths to include public/ or write a plugin to to it for you.

Another option as noted in the comments to this answer (formatted here for readability):

Create an .htaccess file into root folder with this content:

RewriteEngine On 
RewriteRule ^\.htaccess$ - [F] 
RewriteCond %{REQUEST_URI} ="" 
RewriteRule ^.*$ /public/index.php [NC,L] 
RewriteCond %{REQUEST_URI} !^/public/.*$ 
RewriteRule ^(.*)$ /public/$1 
RewriteCond %{REQUEST_FILENAME} -f 
RewriteRule ^.*$ - [NC,L] 
RewriteRule ^public/.*$ /public/index.php 

1

solved Set up zend project in live server [closed]