Setting up Fedora Core 5 for Zend Framework
I installed Apache and MySQL through yum without a hitch and decided I needed to compile my own version of PHP 5. I ran into some problems compiling PHP5, but after resolving those, I had a working LAMP platform. The way ZF is currently set up, it really only works from the root directory of a site (you can use modified controller to get around this), although they are going to change the controller structure so it works in sub-directories in future releases. I have two different sites I want to build using ZF, so I decided to edit my /etc/hosts file to tell my computer to look at itself for two domains:
www.bolton.com localhost
www.tripvera.com localhost
Fedora checks /etc/hosts first when a domain is requested, so a matching line here will prevent it from querying a DNS server and allows you set up any domain you want, even if you don’t own it. You can also use the GUI in System->Administration->Network to add the same entry.
Now I had to modify httpd.conf (use “locate httpd.conf†if you are unsure where yours is) and I uncommented the virtual hosting line in the file, added the virtual directory and placed the mod_rewrite rules into the virtual host, rather than using an .htaccess file in the directory:
ServerAdmin your@email.com
DocumentRoot /var/www/html/bolton
ServerName www.bolton.com
ErrorLog logs/bolton.com-error_log
CustomLog logs/bolton.com-access_log common
RewriteEngine on
RewriteRule !.(js|ico|gif|jpg|png|css)$ index.php
AllowOverride All
Make sure to restart Apache to have the changes to httpd.conf take effect. Finally, I created a new file called .vimrc in my home directory and added “:set tabstop=4â€. This is a config file vi opens whenever it is loaded and that command sets the tabs to 4 spaces, which is the recommended amount by ZF. Vi defaults 8 spaces, which I think it way too much and I use vi a lot for coding. I have been playing around with Eclipse, but that is a topic for another posting…
July 24th, 2006 at 10:25 am
Did you get MYSQli to work when you compiled your version for PHP5 or are you not using Mysql 5?
July 24th, 2006 at 12:20 pm
Yes, I threw in a switch to compile PHP with both MySQLi and MySQL and MySQLi is working fine.