openshift nginx php-fpm wordpress

Trying to have working wordpress in Openshift with nginx, php-fpm

I installed nginx-php-fpm, added mysql, download wordpress files in /www directory, changed wp-config-sample.php to wp-config.php and changed contents to https://github.com/openshift/wordpress-example/blob/master/.openshift/config/wp-config.php
then send it all to openshift app. visiting app url gives me blank white page with no error msg. Further digging into error logs gives me following:

nginx-php-fpm/logs/nginx_error.log

nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log"failed (13: Permission denied)
nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log"failed (13: Permission denied)

nginx-php-fpm/logs/nginx_access.log

[21/May/2014:12:39:16 -0400] "GET / HTTP/1.1" 500 5 "-" "Mozilla/5.0 (Windows NT 6.2) AppleWebKit/829.36 (KHTML, like Gecko) Chrome/ Safari/829.36"

nginx-php-fpm/logs/www-error.log

[21-May-2014 16:39:16 GMT] PHP   1. {main}() /var/lib/openshift/829cd5474382ec640700064e/app-root/runtime/repo/www/index.php:0
[21-May-2014 16:39:16 GMT] PHP   2. require() /var/lib/openshift/829cd5474382ec640700064e/app-root/runtime/repo/www/index.php:17
[21-May-2014 16:39:16 GMT] PHP   3. require_once() /var/lib/openshift/829cd5474382ec640700064e/app-root/runtime/repo/www/wp-blog-header.php:12
[21-May-2014 16:39:16 GMT] PHP   4. require_once() /var/lib/openshift/829cd5474382ec640700064e/app-root/runtime/repo/www/wp-load.php:29
[21-May-2014 16:39:16 GMT] PHP Fatal error:  require_once(): Failed opening required '/var/lib/openshift/829cd5474382ec640700064e/app-root/runtime/repo/.openshift/openshift.inc'(include_path='.:/var/lib/openshift/829cd5474382ec640700064e/app-oot/runtime/repo//libs/:/var/lib/openshift/829cd5474382ec640700064e/nginx-php-fpm//phplib/pear/pear/php/:/usr/share/pear/') in /var/lib/openshift/829cd5474382ec640700064e/app-root/runtime/repo/www/wp-config.php on line 47
[21-May-2014 16:39:16 GMT] PHP Stack trace:
[21-May-2014 16:39:16 GMT] PHP   1. {main}() /var/lib/openshift/829cd5474382ec640700064e/app-root/runtime/repo/www/index.php:0
[21-May-2014 16:39:16 GMT] PHP   2. require() /var/lib/openshift/829cd5474382ec640700064e/app-root/runtime/repo/www/index.php:17
[21-May-2014 16:39:16 GMT] PHP   3. require_once() /var/lib/openshift/829cd5474382ec640700064e/app-root/runtime/repo/www/wp-blog-header.php:12
[21-May-2014 16:39:16 GMT] PHP   4. require_once() /var/lib/openshift/829cd5474382ec640700064e/app-root/runtime/repo/www/wp-load.php:29

nginx-php-fpm/logs/php_error.log

[21-May-2014 12:34:38] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
[21-May-2014 12:34:38] NOTICE: fpm is running, pid 120752
[21-May-2014 12:34:38] NOTICE: ready to handle connections
[21-May-2014 12:41:55] NOTICE: Terminating ...
[21-May-2014 12:41:55] NOTICE: exiting, bye-bye!
[21-May-2014 12:41:56] WARNING: Nothing matches the include pattern '/var/lib/openshift/829cd5474382ec640700064e/app-root/runtime/repo//config/php-pm.d/*.conf' from /var/lib/openshift/829cd5474382ec640700064e/nginx-php-fpm//configuration/etc/php-fpm.conf at line 227.
[21-May-2014 12:41:56] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
[21-May-2014 12:41:56] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
[21-May-2014 12:41:56] NOTICE: fpm is running, pid 143797
[21-May-2014 12:41:56] NOTICE: ready to handle connections

Related posts

Leave a Reply

1 comment

  1. You need to change the log directory url to point to somewhere that your user can write to, like your OPENSHIFT_DATA_DIR, as you do not have write access to /var/log, you should change that in your nginx.conf file.