background preloader

Configuration

Facebook Twitter

Two (or more) Zend Framework projects on a shared host ¶ Focus. Shared hosting environments can be a nightmare when it comes to PHP Web Development, specially in testing stages.

Two (or more) Zend Framework projects on a shared host ¶ Focus

Yes, I know one should not be using and paying for a hosting plan if the code is still not production ready, but I have seen some cases. I will try to show how to have the Zend Framework installed with as many projects as you want (if your server quota allows you to) in the same web space and all these projects sharing the same ZF copy. Suppose that your home directory is /home/mauricio/. From now on, I am going to refer to it as <root>. Create the following file structure under it: What is Zend Framework and How to install it on cPanel ? Multiple websites, one shared framework. Php - Best method for multiple sites running off shared Zend Framework. Examples - Zend_Application. The Bootstrap class itself will typically be fairly minimal; often, it will simply be an empty stub extending the base bootstrap class: class Bootstrap extends Zend_Application_Bootstrap_Bootstrap{} With a corresponding configuration file: ; APPLICATION_PATH/configs/application.ini[production]autoloaderNamespaces[] = "My_"bootstrap.path = APPLICATION_PATH "/Bootstrap.php"bootstrap.class = "Bootstrap"pluginpaths.My_Bootstrap_Resource = "My/Bootstrap/Resource"resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"[testing : production][development : production] Note: Autoloader namespaces Because these examples use custom code, we need to register the namespace prefixes for that code with our configuration; this is done with the autoloaderNamespaces configuration key, which is an array.

Examples - Zend_Application

Additionally, to ensure that custom plugin resources are discovered, we need to register a plugin prefix path with the bootstrap. The other option is to use resource plugins. Install Zend Framework under Linux Cpanel shared account. - eUKhost Official Web Hosting Forum. Zend Framework - Multiple sites with same code. Php - Zend Framework on sub directory on shared hosting. How can I make my php.ini file recursive ? The PHP settings defined in your php.ini file are not recursive.

How can I make my php.ini file recursive ?

What this means is that they do not modify settings in any child folders (which are subdirectories of the current directory). Still confused, here's an example. Let's say you have a php.ini file in your public_html folder. That php.ini file has the PHP memory_limit set to 256M. Only scripts that run directly in your public_html folder will have the memory_limit set to 256M. If you have many folders, creating a php.ini file for each folder would be quite tedious. Updating your suPHP_ConfigPath value in your .htaccess file Making your php.ini file affect all child folders as well is referred to as making the file "recursive". SuPHP_ConfigPath /home/username/public_html This line you entered is specifying the directory where the php.ini is located that you want to make recursive. This change is immediate, so you should see the update right away. Testing your changes Important! Zend Framework - Where to put forms and plugins in project structure.

Framework under shared hosting. Shared hosting zend framework. Zend Framework on shared hosting. Zend Framework on a shared host. When you deploy a Zend Framework website to a shared host, you usually cannot change the DocumentRoot to point at the public/ folder of the website.

Zend Framework on a shared host

As a result the URL to the website is now This doesn’t look very professional, so we’d like to remove it. The easiest way, given a ZF project created using Zend_Tool is this: Create /index.php < ? Php define('RUNNING_FROM_ROOT', true); include 'public/index.php'; This uses the index.php already created by Zend_Tool and means that we don't have to change anything if we move to a VPS host where we can set the DocumentRoot directly to public/. Create /.htaccess SetEnv APPLICATION_ENV development RewriteEngine On RewriteRule .* index.php We create a .htaccess file that redirects every request to index.php. Referencing public facing files Having created a very aggressive, rewrite rule, what about CSS/JS/image files though? Fortunately, we already have a .htaccess file in the public/ folder that correctly handles this situation. Zend bootstrap example. How Do I Make My php.ini File Recursive? - Web Hosting Hub.