Getting Magento up and running is pretty simple. There are a few things to be aware of when launching Magento on Pagoda Box. After reading this, you should be able to:
- Create a local instance of Magento
- Take your local instance of Magento and deploy it to Pagoda Box
- Create a Pagoda database and access it from your Magento app
- Bask in the combined awesomeness of Magento and Pagoda Box
Magento Core Patches
Duplicate Headers Fix (All Versions)
In Magento Community & Enterprise editions, there is a bug with running PHP as a (fast) CGI with FPM. Because FPM does not accept dual status or Content-Type header, the server returns a duplicate header error.
In Community Edition this can cause problems with using the SOAP API, which will also result in broken dashboard graphs. In Enterprise Edition it results in 500 errors when Full Page Caching is enabled.
The problem lies in the file
app/code/core/Mage/Core/Controller/Response/Http.php. This can be patched by downloading this file and placing it at
app/code/local/Mage/Core/Controller/Response/Http.php which will override the core file.
See this Magento Forum Post for more details.
Change Location of Cache File (Versions 220.127.116.11 and Earlier)
Magento versions 18.104.22.168 and earlier store information related to your cache in the
app/etc/ directory. In order to write files to the
app/etc/ directory, it would need to be made writable which would mean that it would no longer be tracked in your git repo. Any changes made to
app/etc/ would then not be committed or deployed. A simple fix for this is to change where the cache file is written. Make the following change to line 1102 of
PHPPatch for Magento Versions 22.214.171.124 and Earlier
Launching Your Magento App
Create a Local Instance of Magento
We’re assuming that you’ve already done this. If you haven’t and don’t know how, here’s a link for you:
Create a local Magento instance
Important: No Auto-Installers on Pagoda Box
You are not able to run auto-installers on Pagoda Box. If you use Magento's auto-installer, run it locally to generate all the necessary configuration files, then deploy your app to Pagoda Box.
During development, we recommend configuring Magento to display errors by making the following change in your index.php file.
Create a Git Repo for Your Magento App
If you haven’t heard of git before, here’s a link just for you:
Getting Started with Git
Magento Boxfile Hosting Configuration
Create a file named "Boxfile" in the base directory of your git repo and paste in the following code snippet. The Boxfile is your Pagoda Box config file. If you want the Boxfile explained in more detail, click here.
YAMLMagento Boxfile Example
Identifying media as a writable directory will allow you to upload images, video, and other media to your live Magento app. The PHP extensions are those required by the Magento System Requirements. The "db1" component will automatically create an empty database for your application.
Also, refer to our Magento Optimization Guide for optional Boxfile settings your app may benefit from.
Save the Boxfile, commit your changes, and push them to your repo.
If you want to know more about writing your own or customizing your Boxfile, check out Boxfile Guide. Any settings you define in your own Boxfile will override settings defined in the default Boxfile.
Deploy Your App on Pagoda Box
Just go through the normal process of deploying your app. If you aren’t sure how to do this, it’s explained here.
Once your app has been successfully created, if you click on "View Live App Online" it will load an error page that looks something like the following:
This is because you haven't configured your app to connect the new Pagoda database instead of your local database.
If you get just screen with an error number, it’s probably because errors haven't been configured to display.
Local vs. Production Environments
Since Magento doesn’t natively accommodate database settings for multiple environments(local vs production), we recommend using git branching to handle that.
At this point, your master branch should contain your local database settings. Create a new branch that will retain those development database settings.
Create a new branch with a name something like “dev”.
Link Your App to the Database
Go to your app dashboard and click on the database that was created by your Boxfile. If you didn't use the example Boxfile, create a database manually from the dashboard.
Click on the "Show Credentials" link on the database component and take note of the credentials.
In your app/etc/local.xml file, replace the values of ‘host’, ‘username’, ‘password’, and ‘dbname’ with the corresponding credentials of the database you just created.
XMLSet Your Database Credentials
Save your local.xml file, commit your changes & push to pagoda.
Get Your Local Database to Pagoda
Export your local database with your favorite local database administration tool(e.g. phpMyAdmin, Sequel Pro, etc.).
Import your database into your live app on Pagoda using the database tunnel
Adjust your urls in the core_config_data table to match your live site.
Now when you go to yourapp.pagodabox.com you should see your Magento app running on Pagoda!
If you set errors to display, now would be a good time to turn it off, unless you're still debugging your Magento app.
This guide has only covered the minimum requirements for getting Magento up and running. Check out our Magento Optimization Guide for additional suggestions and configuration options.
Post-launch Workflow Recommendations
Things to Note
Pagoda Box makes managing and updating your Magento app really easy, but there’s some things you should know.
For security reasons, Pagoda Box only allows SSH or FTP access to your writable directories, but not your application code. This means that any updates, plugins, themes, or any other code changes need to be done on your local instance first, then pushed to your repo and deployed through your app dashboard.
Remember that your local database and your live database are two completely separate databases. Anytime you want to publish a new post or add media to your Magento app, it needs to be done through your live admin, not your local admin. Your Magento content is not stored in your repo so any content you add locally will not be pushed live with your repo.
Suggested GIT workflow
Here’s what a typical git workflow might look like:
TerminalSuggested GIT Workflow
Table of Contents
- Duplicate Headers Fix (All Versions)
- Change Location of Cache File (Versions 126.96.36.199 and Earlier)
- Cache File Patch
Launching Your Magento App
- Create a Local Instance of Magento
- Display Errors
- Display Errors
- Create a Git Repo for Your Magento App
- The All-Powerful Boxfile
- Magento Specific Boxfile
- Deploy Your App to Pagoda Box
- Local vs. Production Environments
- GIT Branching
- Create a Database and Link Your App to It
- Set Your Database Credentials
- Get Your Local Database to Pagoda