Working on PHPFog Locally
Since I'm a cheap miser (jk - I'm just haven't made enough cool apps to justify my getting a server) I use the free option on PHPFog to host apps. PHPFog is just like Heroku except with PHP. You use git to push your content to the cloud (no FTP uploads for websites) and they provide easy server setup for your PHP app.
The nice thing about uploading using git is that in the meantime, you can test your application locally. There are, however, a few things to set up so that you can work locally. The most minor details lie in the config files where you'll have to make sure of some things like:
in config.php you really don't want to be setting a base_url since you want your app to work both locally and on PHPFog's servers.
database.php - set it up using the database configuration options from the PHPFog website including the hostname. Now here is one tricky part - I have a hostname of db01-share on PHPFog but I don't want to change that to localhost (cause then when I push the code to the servers, things will not work). So what I did was edit the hosts file on Windows 7 to redirect to 127.0.0.1 (localhost) and this worked fine, but not on Mac Lion. Dammit.
Don't forget to create the user from PHPFog in your own database. This brings up the point of whether phpMyAdmin's sync servers function can be used...but I'm a budding web developer and I have never used that feature before. I always like going the DIY route anyway.
I really don't understand why I can't connect to the database from my Mac as hostname 'db01-share' but if I do, I'll come back and edit this post or something.
















