Giter Site home page Giter Site logo

heroku-buildpack-wordpress's Introduction

Heroku buildpack: WordPress on Heroku

See also

Heroku now (2015) supports PHP in the standard stack.

This is a Heroku buildpack for running WordPress on Heroku

It uses this WordPress project template to bootstrap a highly tuned WordPress site built on the following stack:

  • nginx - Nginx for serving web content. Built specifically for Heroku. See compile options.
  • php - PHP-FPM for process management. See compile options.
  • wordpress - Downloaded directly from wordpress.org.
  • MySQL - ClearDB for the MySQL backend.
  • Sendgrid - Sendgrid for the email backend.
  • MemCachier - MemCachier for the memcached backend.

You can see a live demo at WordPress on Heroku.

Getting started in 60 seconds

Fork and rename the WordPress project template.

Let's clone the repository for a new blog, 99catfacts.com

$ git clone git://github.com/your_name/wordpress-on-heroku.git 99catfacts.com

Create WordPress on Heroku.

$ cd 99catfacts.com
$ heroku create -s cedar
$ heroku config:add BUILDPACK_URL=https://github.com/mchung/heroku-buildpack-wordpress.git

Don't have the Heroku Toolbelt installed? Follow these quickstart instructions. Takes about 2 minutes.

Deploy your WordPress site to Heroku.

$ git push heroku master
...
-----> Heroku receiving push
-----> Fetching custom git buildpack... done
-----> WordPress app detected
.
[...]
.
-----> Discovering process types
       Procfile declares types     -> (none)
       Default types for WordPress -> web
-----> Compiled slug size: 33.7MB
-----> Launching... done, v7

Open your new WordPress site in a web browser.

$ heroku apps:open

Happy? Add your site to the growing list of WordPress sites runnning on Heroku.

Overview

The buildpack bootstraps a WordPress site using the mchung/wordpress-on-heroku project template. That repo contains everything required to run your own WordPress site on Heroku.

There are several files available in config for configuring your new WordPress site.

└── config                # Your config files goes here.
    ├── public            # The public directory
    │   └── wp-content    # WordPress themes and plugins
    │       ├── plugins
    │       └── themes
    └── vendor            # Config files for vendored apps
        ├── nginx
        │   └── conf      # nginx.conf + your site.conf
        └── php
            └── etc       # php.ini & php-fpm.conf

When you deploy WordPress to Heroku, everything in config is copied over to Heroku. You can configure your blog by making changes to these files.

A few WordPress environment variables can be controlled via Heroku using heroku config:set:

To add a Heroku environment variable: heroku config:set GOOG_UA_ID=UA=1234777-9

See wp-config.php and documentation from WordPress for details.

Enabling and configuring the following WordPress plugins will also speed up WordPress on Heroku significantly.

  • heroku-sendgrid - Configures phpmailer to send SMTP email with Sendgrid.
  • heroku-google-analytics - Configures Google Analytics to display on your WordPress site.
    • GOOG_UA_ID=UA-9999999
  • wpro - Configures WordPress to upload everything to S3.
  • batcache - Configures WordPress to use memcached for caching.
  • memcachier - Use a modern memcached plugin.
  • cloudflare - OPTIONAL, but very awesome.
  • If Cloudflare is installed, the plugin configures WordPress to play nicely with CloudFlare. It sets the correct IP addresses from visitors and comments, and also protects WordPress from spammers.
  • Keep in mind that the free version doesn't support SSL, so you'll need to set both FORCE_SSL_ADMIN and FORCE_SSL_LOGIN to false in order to login.

Usage

Creating your WordPress site on Heroku

$ git clone git://github.com/username/wordpress-on-heroku.git myblog
$ cd myblog
$ heroku create -s cedar
$ heroku config:add BUILDPACK_URL=https://github.com/mchung/heroku-buildpack-wordpress.git
$ git push heroku master

Adding a custom domain name

$ heroku domains:add marcchung.org
$ heroku domains:add www.marcchung.org

Note: Adding a domain still requires some DNS setup work. Basically you'll want to do something like this:

ALIAS marcchung.org -> proxy.herokuapp.com
CNAME www.marcchung.org -> proxy.herokuapp.com

I use DNSimple and you should too.

Adding a theme

$ cp -r appply config/public/wp-content/themes/
$ git add .
$ git commit -m "New theme"
$ git push heroku master

Adding a plugin

$ cp -r google-analytics config/public/wp-content/plugins/
$ git add .
$ git commit -m "New plugin"
$ git push heroku master

Plugins and themes must be activated via the Plugins panel.

Adding custom secret keys to wp-config.php

Use the WordPress.org secret-key service to override the default ones in wp-config.php.

Configuring cron

By default, wp-cron is fired on every page load and scheduled to run jobs like future posts or backups. This buildpack disables wp-cron so that visitors don't have to wait to see the site.

Heroku allows you to trigger wp-cron from their scheduler.

$ heroku addons:add scheduler:standard

# Visit the Heroku scheduler dashboard and add a new task:
./bin/cron.sh

Alternatively, you may also re-enable wp-cron.

$ heroku config:set DISABLE_WP_CRON=false

Enable system access

The alternative PHP cache and a generic PHPINFO page is available at /apc.php and /phpinfo.php.

$ heroku config:set ENABLE_SYSTEM_DEBUG=true
$ heroku config:set SYSTEM_USERNAME=admin
$ heroku config:set SYSTEM_PASSWORD=secret123
# Visit /apc.php or /phpinfo.php

Remove the PHP-FPM status page /status.html

Delete the directive from nginx.conf.erb.

Add a favicon.ico drop one into public

See #22 for details.

Specifying WordPress installation directory

Specifying a WordPress installation directory may help local development as you can just unzip wordpress into a subdirectory and .gitignore that folder.

$ heroku config:set WORDPRESS_DIR=mywordpress

wp-config.php:

define( 'WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'].'/wp-content' );
define( 'WP_CONTENT_URL', 'http://' . $_SERVER['HTTP_HOST'] .'/wp-content' );
define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/mywordpress');

Choosing specific versions of vendored packages

See VERSIONS for how to pick specific versions of Nginx, PHP, and WordPress

Workflow (optional)

By keeping your changes separate, it'll be easier to pull in changes from the WordPress site template.

Assign a remote upstream

$ git remote add upstream https://github.com/your_name/wordpress-on-heroku.git

Track changes in a separate branch called production.

$ git checkout -B production
$ git push heroku production:master
# This keeps upstream (my) changes separate from (your) blog changes.

Pull changes from upstream into master.

$ git co master
$ git pull
$ git co production
$ git merge master

Pull changes from upstream into production.

$ git pull --rebase upstream master

How fast is this?

Pretty freaking fast.

System setup

  • Single Heroku dyno
  • Default WordPress installation
  • Default twentytwelve theme
  • Caching turned up
  • Cron disabled
  • Memcachier + ClearDB

Here are some benchmarks from Google PageSpeed, Blitz.io, and Web Page Test.

Google PageSpeed

Results from PageSpeed Insights: 94/100

See the PageSpeed report

blitz.io

Results from a blitz.io rush

Blitz.io rush

Over 200 page views per second with less than 100ms response time sustained for a minute.

See the Blitz.io report

Web Page Performance Test

Results from WebPageTest

See the WebPageTest report

These tests are periodically rerun on WordPress on Heroku.

But doesn't Heroku only run Ruby applications?

Not anymore. Heroku's latest offerings (See Celadon Cedar stack) makes it easy (well, easyish) for developers to install and run any language, or service.

Constraints with Heroku

The ephemeral filesystem

  • End-users cannot upload media assets to Heroku. WORKAROUND: Enable wpro and use that plugin to upload media assets to S3 instead.
  • End-users cannot update themes or plugins from the admin page. WORKAROUND: Add them to config/public/wp-content/themes or config/public/wp-content/plugins then push to Heroku.

Security disclosure

Each time WordPress is deployed, Heroku will fetch the latest buildpack from GitHub and execute the instructions in compile and deploy. This buildpack will download the latest precompiled versions of Nginx, PHP, and WordPress from my personal S3 bucket then add in config files from the config directory.

Hacking and Contributing

Not comfortable downloading and running a copy of someone else's PHP or Nginx executables? Not a problem! The support directory also contains a handful of compilation and deployment scripts to automate several processes, which are currently used for maintenance and repo management.

  • package_nginx - Used to compile and upload the latest version of Nginx to S3.
  • package_php - Used to compile and upload the latest version of PHP to S3.
  • wordup - Really useful helper script for creating and destroying WordPress sites.

TODO

  • End-users shouldn't be able to do things that aren't supported on Heroku. Write plugins to hide everything.
  • Integrate New Relic.
  • CDN support.
  • Combine CSS/JS files

Authors and Contributors

Thanks

Thanks for reading this all the way through.

If you use this buildpack in production, please update the list of WordPress sites running on Heroku.

License

The MIT License - Copyright (c) 2013 Marc Chung

take my code with you
and do whatever you want
but please don't blame me
— Aaron Swartz
This Haiku brought to you by Haikuist

heroku-buildpack-wordpress's People

Contributors

bryankaplan avatar luisherranz avatar m avatar mchung avatar okko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

heroku-buildpack-wordpress's Issues

Gallery Plugins Won't Install

So I've tried to install the Mikado Gallery (http://codecanyon.net/item/mikado-grid-gallery-for-wordpress/7028624) and the Simple Viewer Gallery (http://www.simpleviewer.net/simpleviewer/support/wp-simpleviewer/) and neither will work. I even tried the Next-Gen Gallery and was unable to upload images (probably an S3 issue with WPRO).

The Mikado Gallery errors out at the point of creating a gallery. Not sure if it's trying to create a new database table, write to a directory that may be off limits, or other.

Either way, I believe that these galleries work on a standard install of Wordpress. Not sure if you know of a gallery plugin that works with this Heroku+S3+Wordpress stack or not, or if the underlying issue can be addressed.

Exception thrown from MemchacheSASL.php

Hi there,

I've just set up a new WP instance based on your template project (master branch), and deployed it with this buildpack, following the instructions provided. Unfortunately, the Memcachier plugin seems to be throwing an execption on startup. Wondering if you can help me clear it up?

I'm hoping I just missed something obvious...


2013-02-18T16:14:22+00:00 app[web.1]: #0 /app/public/wp-content/object-cache.php(373): MemcacheSASL->setSaslAuthData('33161c', '464db331c80827f...')
2013-02-18T16:14:22+00:00 app[web.1]: #1 /app/public/wp-content/object-cache.php(63): WP_Object_Cache->WP_Object_Cache()
2013-02-18T16:14:22+00:00 app[web.1]: #2 /app/public/wp-content/advanced-cache.php(203): wp_cache_init()
2013-02-18T16:14:22+00:00 app[web.1]: Stack trace:
2013-02-18T16:14:22+00:00 app[web.1]: 2013/02/18 16:14:22 [error] 27#0: *5 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught exception 'Exception' in /app/public/wp-content/plugins/memcachier/MemcacheSASL.php:117
2013-02-18T16:14:22+00:00 app[web.1]: #4 /app/public/wp-config.php(115): require_once('/app/public/wp-...')
2013-02-18T16:14:22+00:00 app[web.1]: #6 /app/public/wp-blog-header.php(12): require_once('/app/public/wp-...')
2013-02-18T16:14:22+00:00 app[web.1]: [18-Feb-2013 16:14:22] WARNING: [pool www] child 19 said into stderr: "#3 /app/public/wp-settings.php(58): include('/app/public/wp-...')"
2013-02-18T16:14:22+00:00 app[web.1]: [18-Feb-2013 16:14:22] WARNING: [pool www] child 19 said into stderr: "Stack trace:"
2013-02-18T16:14:22+00:00 app[web.1]: [18-Feb-2013 16:14:22] WARNING: [pool www] child 19 said into stderr: "#0 /app/public/wp-content/object-cache.php(373): MemcacheSASL->setSaslAuthData('33161c', '464db331c80827f...')"
2013-02-18T16:14:22+00:00 app[web.1]: [18-Feb-2013 16:14:22] WARNING: [pool www] child 19 said into stderr: "#1 /app/public/wp-content/object-cache.php(63): WP_Object_Cache->WP_Object_Cache()"
2013-02-18T16:14:22+00:00 app[web.1]: #3 /app/public/wp-settings.php(58): include('/app/public/wp-...')
2013-02-18T16:14:22+00:00 app[web.1]: thrown in /app/public/wp-content/plugins/memcachier/MemcacheSASL.php on line 117" while reading response header from upstream, client: 10.102.13.172, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-fpm.socket:", host: "XXXXX.herokuapp.com"
2013-02-18T16:14:22+00:00 app[web.1]: [18-Feb-2013 16:14:22] WARNING: [pool www] child 19 said into stderr: "NOTICE: PHP message: PHP Fatal error: Uncaught exception 'Exception' in /app/public/wp-content/plugins/memcachier/MemcacheSASL.php:117"
2013-02-18T16:14:22+00:00 app[web.1]: [18-Feb-2013 16:14:22] WARNING: [pool www] child 19 said into stderr: "#2 /app/public/wp-content/advanced-cache.php(203): wp_cache_init()"
2013-02-18T16:14:22+00:00 app[web.1]: [18-Feb-2013 16:14:22] WARNING: [pool www] child 19 said into stderr: "#4 /app/public/wp-config.php(115): require_once('/app/public/wp-...')"
2013-02-18T16:14:22+00:00 app[web.1]: [18-Feb-2013 16:14:22] WARNING: [pool www] child 19 said into stderr: "#6 /app/public/wp-blog-header.php(12): require_once('/app/public/wp-...')"
2013-02-18T16:14:22+00:00 app[web.1]: [18-Feb-2013 16:14:22] WARNING: [pool www] child 19 said into stderr: "#7 /app/public/index.php(17): require('/app/public/wp-...')"
2013-02-18T16:14:22+00:00 app[web.1]: #7 /app/public/index.php(17): require('/app/public/wp-...')
2013-02-18T16:14:22+00:00 app[web.1]: [18-Feb-2013 16:14:22] WARNING: [pool www] child 19 said into stderr: "#5 /app/public/wp-load.php(29): require_once('/app/public/wp-...')"
2013-02-18T16:14:22+00:00 app[web.1]: [18-Feb-2013 16:14:22] WARNING: [pool www] child 19 said into stderr: " thrown in /app/public/wp-content/plugins/memcachier/MemcacheSASL.php on line 117"
2013-02-18T16:14:22+00:00 app[web.1]: [18-Feb-2013 16:14:22] WARNING: [pool www] child 19 said into stderr: "#8 {main}"
2013-02-18T16:14:22+00:00 app[web.1]: 10.102.13.172 - - [18/Feb/2013:16:14:22 +0000] "GET / HTTP/1.1" 500 5 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.68 Safari/537.22"
2013-02-18T16:14:22+00:00 app[web.1]: #5 /app/public/wp-load.php(29): require_once('/app/public/wp-...')
2013-02-18T16:14:22+00:00 app[web.1]: #8 {main}

Error R14: Memory quota exceeded

I'm getting the R14 "Memory quota exceeded" error since 30th of August. I didn't change anything in my files, so maybe this is due to a change Heroku has made to its servers.

Anyone experiencing the same problem?
heroku web.1 - - Process running mem=512M(100.1%) heroku web.1 - - Error R14 (Memory quota exceeded)

screen shot 2013-09-02 at 5 10 13 pm

I've activated the memory usage log report (https://devcenter.heroku.com/articles/log-runtime-metrics) and it looks like a memory leakage problem, but as I said, I didn't change anything and the website was working fine since the 30th.

Why check for directory existence at all in compile script?

On lines 65 and 73 of the compile script, why check to see if the directory doesn't exist? e.g.

if [ ! -d ./vendor/nginx ]; then
  echo "-----> Installing Nginx v${NGINX_VERSION}"
  mkdir -p ./vendor/nginx && cd ./vendor/nginx
  curl --silent --max-time 60 --location $NGINX_URL | tar xz
fi

For instance, the Heroku PHP buildpack always downloads and extracts the binaries, https://github.com/heroku/heroku-buildpack-php/blob/master/bin/compile. Is there a performance gain by checking? Won't the directories exist after the initial compile? Thanks in advance...

cleardb has issues

I occasionally experience disconnects "NOTICE: PHP message: WordPress database error MySQL server has gone away for query SELECT........"

Sent in a ticket to ClearDB, the support response from ClearDB was:
Thanks for your interest in ClearDB. One of the more common items that come up while working with our clusters is that our routers automatically close idle connections after 90 seconds. Depending on how your connection logic is coded, there may be cases in which your application (which appears to be wordpress) will attempt to re-use a connection that has been closed on our end due to the idle timeout. You may want to see about adding retry logic into your code so that this does not happen.

What do?

Unable to launch app

Hi, this looks great but I'm unable to push this into production because the slug compilation fails. If I run heroku logs, you can see the following:

2012-05-13T00:54:11+00:00 heroku[slugc]: Slug compilation started
2012-05-13T00:55:02+00:00 heroku[slugc]: Slug compilation failed: unrecognized error

This is the output from running git push heroku master:

➜  wordpress-on-heroku git:(master) git push heroku master
Counting objects: 1167, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (1013/1013), done.
Writing objects: 100% (1167/1167), 5.67 MiB | 215 KiB/s, done.
Total 1167 (delta 133), reused 1160 (delta 130)

-----> Heroku receiving push
-----> Fetching custom buildpack... done
-----> Wordpress app detected
-----> Installing Nginx
-----> Bundling Nginx v1.2.0
-----> Installing PHP
-----> Bundling PHP v5.4.1
-----> Installing boot script
-----> Done with compile
-----> Discovering process types
       Procfile declares types     -> (none)
       Default types for Wordpress -> web
-----> Compiled slug size is 33.1MB
-----> Launching...
 !     Heroku push rejected due to an unrecognized error.
 !     We've been notified, see http://support.heroku.com if the problem persists.
To [email protected]:bummercloud.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '[email protected]:bummercloud.git'

no Cedar-supported app detected

Hi,
I was following the directions on http://mchung.github.io/heroku-buildpack-wordpress/ and everything worked fine up until I went to push the app to heroku. When I did that, I got the error that no Cedar-supported app was detected:

$ git push heroku master
Counting objects: 414, done.
Compressing objects: 100% (293/293), done.
Writing objects: 100% (414/414), 7.11 MiB | 637 KiB/s, done.
Total 414 (delta 121), reused 414 (delta 121)
-----> Fetching custom git buildpack... done
 !     Push rejected, no Cedar-supported app detected
To [email protected]:morning-peak-8406.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '[email protected]:morning-peak-8406.git'

Did I miss something in the setup? Thanks

Issue upgrading to 3.9: Can't get into admin area

Hi!, I just upgraded to 3.9 (i am doing the upgrades by changing the config var WORDPRESS_VERSION in my heroku app, which worked fine until now)

After the upgrade when i accessed to the admin panel I got a message "you database needs to upgrade" or something like that. It did the database upgrade but now everytime i try to get into the admin area i get a message "upgrade is not necessary, your WordPress database is already updated" (I have it in spanish so it might not say exactly that in english), and the url I get is always: https://........com/wp-admin/upgrade.php?_wp_http_referer=%2Fwp-admin%2F.

I tried to downgrade to 3.8.1 and it works fine, I upgrade again to 3.9 and same problem.

Any ideas?

Thanks in advance

Upgrade to Nginx Stable

sudo -s
nginx=stable # use nginx=development for latest development version
add-apt-repository ppa:nginx/$nginx
apt-get update
apt-get install nginx

Really need to do some work to support a local development copy

I've now gone through the exercise twice of setting up a local copy and it's a big pain. I think it's worth trying to make some generic config so that one is able to run a local copy without too much pain. It basically involves having two wp-config.php files and having a vendor copy of wordpress. I have not figured out how to deal with memcachesasl locally yet, i just disable it.

I also had to do this to object-cache.php but it seems hacky

diff --git a/config/public/wp-content/object-cache.php b/config/public/wp-content/object-cache.php
index c4486c2..1f5e232 100644
--- a/config/public/wp-content/object-cache.php
+++ b/config/public/wp-content/object-cache.php
@@ -353,14 +353,12 @@ class WP_Object_Cache {

                global $memcachier_servers;

-               if ( isset($memcachier_servers) )
-                       $buckets = $memcachier_servers;
-               else
-                       $buckets = array(
-                               'default' => array(
-                                       getenv("MEMCACHIER_SERVERS")
-                               )
-                       );
+    if ( isset($memcachier_servers) )
+      $buckets = $memcachier_servers;
+    elseif (getenv("MEMCACHIER_SERVERS"))
+      $buckets = array( 'default' => array( getenv("MEMCACHIER_SERVERS")));
+    else
+      $buckets = array('default' => array( 'localhost:11211' ));

                reset($buckets);

@@ -370,7 +368,7 @@ class WP_Object_Cache {
                                list ( $node, $port ) = explode(':', $server);

                                $this->mc[$bucket]->addServer($node, $port);
-                               $this->mc[$bucket]->setSaslAuthData(getenv("MEMCACHIER_USERNAME"), getenv("MEMCACHIER_PASSWORD"));
+        if(getenv("MEMCACHIER_USERNAME")) $this->mc[$bucket]->setSaslAuthData(getenv("MEMCACHIER_USERNAME"), getenv("MEMCACHIER_PASSWORD"));

                        }
                }

Request for new vendor package

Hi-

Not sure if this is as simple as changing the bin/compile file or if that will break it.

Trying to upgrade to:

Wordpress 3.6

Thank you for this buildback! Great stuff
Emile

Launch fails - start.sh is not found

on an updated (master) deploy, start.sh is not found
Heroku logs:

heroku[slug-compiler]: Slug compilation finished
heroku[web.1]: Starting process with command `start.sh`
app[web.1]: bash: start.sh: command not found
heroku[web.1]: Process exited with status 127
heroku[web.1]: State changed from starting to crashed

Does PATH config need to be defined?

So I utilized this build pack without the companion wordpress git you have. (Just stole the config directory)

I had to add the PATH var that was specified in the "release" of the buildpack as the intance was unable to find both PHP and Nginx.

heroku config:add PATH=/app/vendor/nginx/sbin:/app/vendor/php/bin:/app/vendor/php/sbin:/usr/local/bin:/usr/bin:/bin

This method works but I am not sure if i simply missed a step?

Disable auto-updates?

Wordpress is auto-updating its core to 3.8.1 everyday. And due to Heroku ephimeral system it goes back to 3.8 once the dyno restarts.

Is any way to prevent this? is it safe to update wordpress manually just following their documentation?

Heroku Papertrail Reporting Error

Feb 11 07:57:43 sleepy-citadel-2943 app/scheduler.8263: cp: cannot stat `/app/vendor/php/apc.php': No such file or directory
Feb 11 07:57:43 sleepy-citadel-2943 app/scheduler.8263: PHP Warning: PHP Startup: Unable to load dynamic library '/app/vendor/php/lib/php/extensions/no-debug-non-zts-20121212/apc.so' - /app/vendor/php/lib/php/extensions/no-debug-non-zts-20121212/apc.so: cannot open shared object file: No such file or directory in Unknown on line 0

Question about assets

If I want to add images to my site, can I do it with the control panel uploader, or do I need to put it somewhere and push it? Is this the same for adding css and javascript to a theme?

Added @okko as a collaborator

As @okko has been submitting more PRs recently, I think it'd be a good idea to add him as a collaborator to both heroku-buildpack-wordpress and wordpress-on-heroku.

Import old wordpress websites

Hi

I tried to import my company blog using the wordpress import plugin.
But when I try to do it the following message appears:
"The export file could not be found at . It is likely that this was caused by a permissions problem."

What do you think? Any good idea to import another wordpress website?

Thanks in advance

Doesn't seem to deploy on Dokku

Hi!

Tried deploying on Dokku but somehow it seems like the NGINX can't connect to the upstream PHP.

If anyone has a hint i'll try to patch it up this weekend.

Starting nginx
cp: cannot stat `/app/vendor/php/apc.php': No such file or directory
[14-Apr-2014 14:39:40] NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library '/app/vendor/php/lib/php/extensions/no-debug-non-zts-20121212/apc.so' - /app/vendor/php/lib/php/extensions/no-debug-non-zts-20121212/apc.so: cannot open shared object file: No such file or directory in Unknown on line 0
[14-Apr-2014 14:39:40] ERROR: [pool www] cannot get gid for group 'nobody'
[14-Apr-2014 14:39:40] ERROR: FPM initialization failed
[14-Apr-2014 14:39:40] ERROR: [pool www] cannot get gid for group 'nobody'
[14-Apr-2014 14:39:40] ERROR: FPM initialization failed
2014/04/14 14:51:35 [crit] 32#0: *1 connect() to unix:/tmp/php-fpm.socket failed (2: No such file or directory) while connecting to upstream, client: 172.17.42.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-fpm.socket:", host: "wordpress.localhost"
172.17.42.1 - - [14/Apr/2014:14:51:35 +0000] "GET / HTTP/1.1" 502 172 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/537.75.14"
2014/04/14 14:51:37 [crit] 32#0: *4 connect() to unix:/tmp/php-fpm.socket failed (2: No such file or directory) while connecting to upstream, client: 172.17.42.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-fpm.socket:", host: "wordpress.localhost"
172.17.42.1 - - [14/Apr/2014:14:51:37 +0000] "GET / HTTP/1.1" 502 172 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/537.75.14"
2014/04/14 14:51:45 [crit] 32#0: *6 connect() to unix:/tmp/php-fpm.socket failed (2: No such file or directory) while connecting to upstream, client: 172.17.42.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-fpm.socket:", host: "wordpress.localhost:8080"
172.17.42.1 - - [14/Apr/2014:14:51:45 +0000] "GET / HTTP/1.1" 502 172 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/537.75.14"
2014/04/14 14:51:54 [crit] 32#0: *9 connect() to unix:/tmp/php-fpm.socket failed (2: No such file or directory) while connecting to upstream, client: 172.17.42.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-fpm.socket:", host: "wordpress.localhost"
172.17.42.1 - - [14/Apr/2014:14:51:54 +0000] "GET / HTTP/1.1" 502 172 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/537.75.14"
2014/04/14 14:53:14 [crit] 32#0: *11 connect() to unix:/tmp/php-fpm.socket failed (2: No such file or directory) while connecting to upstream, client: 172.17.42.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-fpm.socket:", host: "127.0.0.1:49153"
172.17.42.1 - - [14/Apr/2014:14:53:14 +0000] "GET / HTTP/1.1" 502 172 "-" "curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3"
2014/04/14 14:53:22 [crit] 32#0: *13 connect() to unix:/tmp/php-fpm.socket failed (2: No such file or directory) while connecting to upstream, client: 172.17.42.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-fpm.socket:", host: "127.0.0.1:49153"
172.17.42.1 - - [14/Apr/2014:14:53:22 +0000] "GET / HTTP/1.1" 502 172 "-" "curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3"
2014/04/14 14:53:57 [crit] 32#0: *15 connect() to unix:/tmp/php-fpm.socket failed (2: No such file or directory) while connecting to upstream, client: 172.17.42.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-fpm.socket:", host: "wordpress.localhost"
172.17.42.1 - - [14/Apr/2014:14:53:57 +0000] "GET / HTTP/1.1" 502 172 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/537.75.14"

"Unrecognized error" on pushing to heroku

This buildpack must be cool.
But I am facing an error on pushing to heroku.

What should I check to fix?

I followed instruction on document and saw these:

$ git push heroku master
Counting objects: 1161, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (1007/1007), done.
Writing objects: 100% (1161/1161), 5.66 MiB | 161 KiB/s, done.
Total 1161 (delta 130), reused 1161 (delta 130)

-----> Heroku receiving push
-----> Fetching custom buildpack... done
-----> Wordpress app detected
-----> Installing Nginx
-----> Bundling Nginx v1.2.0
-----> Installing PHP
-----> Bundling PHP v5.4.1
-----> Installing boot script
-----> Done with compile
-----> Discovering process types
       Procfile declares types     -> (none)
       Default types for Wordpress -> web
-----> Compiled slug size is 33.1MB
-----> Launching...
 !     Heroku push rejected due to an unrecognized error.
 !     We've been notified, see http://support.heroku.com if the problem persists.


To [email protected]:yando-wordpress.git
 ! [remote rejected] master -> master (pre-receive hook declined)

Add favicon?

Loving this buildpack!

One issue - any idea how we can add a favicon?

thx.

Contact Form 7 & From email address using Sendgrid

First of all, this project is great!! I love heroku and have done most of my dev work on Rails, but decided to do a Wordpress site for a client and it's been great. Good work!

But, I'm running into a problem. I'm using the Contact Form 7 plugin, and I want emails to be sent using the email address the user entered from the "from" header. It's not respecting that and I believe it's due to your SendGrid for Wordpress on Heroku plugin, where it's set based on the admin_email. I'm guessing there may be an easy way to work around that, but I'm not yet familiar enough with php or wordpress to figure it out. Wondered if you could give me any help...

Thanks!

/status.html still works after nginx directive removal

Didn't want the /status.html page to load, so I followed your tip in the README to remove the nginx directive. I did so in the file wordpress.conf.erb (there is no nginx.conf.erb), committed and pushed the change to Heroku, to no avail. Maybe I have to wait for the process to die on Heroku? Not sure...new to using the platform.

New project template layout

I've refactored the project template mchung/wordpress-on-heroku layout.

It now mirrors the /app directory

└── config                # Config files
    ├── public            # Public directory
    │   └── wp-content    # Themes & plugins
    │       ├── plugins
    │       └── themes
    └── vendor            # Config files for vendored apps
        ├── nginx
        │   └── conf      # nginx.conf + wordpress.conf.erb
        └── php
            └── etc       # php.ini & php-fpm.conf

Before, bin/compile was copying over individual files one by one. The idea behind mirroring the directory is that we can now just do cp -rf /app/config/* /app and have everything correctly copy over. In addition, as an owner, you can now put stuff in public and it will be copied over as well (images, js, css, etc).

It is a breaking change, so I'm planning to tag both mchung/wordpress-on-heroku and mchung/heroku-buildpack-wordpress so that existing blogs may set a different BUILDPACK_URL and have backwards compatibility.

Push rejected - "this add-on" requires a billable account with credit card...

Using this buildpack failed, apparently something in it is not allowed on the Heroku free tier.

I am new to Heroku (and new to Wordpress) and was wondering if you know what it is in your configuration that requires a billable account, and if it either can be removed, or the costs estimated.

$ heroku config:add BUILDPACK_URL=https://github.com/mchung/heroku-buildpack-wordpress.git
Setting config vars and restarting secret-thicket... done, v3
BUILDPACK_URL: https://github.com/mchung/heroku-buildpack-wordpress.git

$ git push heroku master
Counting objects: 279, done.
Compressing objects: 100% (187/187), done.
Writing objects: 100% (279/279), 1.08 MiB | 740 KiB/s, done.
Total 279 (delta 82), reused 279 (delta 82)

-----> Fetching custom git buildpack... done
-----> Wordpress app detected
-----> Installing Nginx v1.4.1
-----> Installing PHP v5.4.11
-----> Installing Wordpress v3.5.2
-----> Writing start.sh script
-----> Done with compile
-----> Discovering process types
       Procfile declares types     -> (none)
       Default types for Wordpress -> web

-----> Compiled slug size: 32.9MB
-----> Launching...
 !     Push rejected, Please verify your account to install this add-on
For more information, see http://devcenter.heroku.com/categories/billing
Verify now at https://heroku.com/verify

To [email protected]:secret-thicket.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '[email protected]:secret-thicket.git'

Using Heroku Scheduler to execute wp-cron.php

I'm trying first in the heroku bash and when I try to run this:
"~/vendor $ php ../public/wp-cron.php"
I get this error:
"Warning: require_once(./wp-load.php): failed to open stream: No such file or directory in /app/public/wp-cron.php on line 26

Fatal error: require_once(): Failed opening required './wp-load.php' (include_path='.:/app/vendor/php/lib/php') in /app/public/wp-cron.php on line 26"

Do you know what may be the issue?

can't make minify rewrite work

I simply can't get this rewrite to work, perhaps someone who understands nginx better than i do can help, from what i can tell it's ignoring the existance of this rewrite
i've tried it in a bunch of places

rewrite  ^/wp-content/cache/minify-(.+?)-(.*?)\.(css|js)$ /wp-content/plugins/minify/make.php?hash=$1&type=$3&incr=$2 break;

putting it the css/js location causes it to serve the make.php file instead of processing it.

 location ~ \.(css|js|htc)$ {
    #rewrite  ^/wp-content/cache/minify-(.+?)-(.*?)\.(css|js)$ /wp-content/plugins/minify/make.php?hash=$1&type=$3&incr=$2 break; 
    try_files       $uri =404;
    expires         max;
    add_header      Pragma "public";
    add_header      Cache-Control "max-age=31536000, public, must-revalidate, proxy-revalidate";
    #access_log      off;
  }

Be able to install Jetpack

I successfully setup a wordpress site using this amazing buildpack. It's run pretty well and fast.

But there's an unexpected issue. When I try to install Jetpack plugins (commit in local git repo and push to heroku).

There an error occur, when I authorize Jetpack with wordpress.com, it redirected to Nginx error. Refresh the admin and try to config some Jetpack options, the site is always redirect to /wp-admin with no parameters at all. So don't know how to install this plugins properly.

Btw, If I try to disconnect Jetpack with WP.com and reconnect again, a problem bellow occur.

Your Jetpack has a glitch. Something went wrong that’s never supposed to happen. Guess you’re just lucky: missing_secrets

Try to find the solutions in google but most of them said that would be Plugins conflict. I did try to deactivate and remove others but nothing helps.

Please advice if I do anything wrong.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.