5

I am attempting to set up phpbb on an EC2 server. After an hour or so of despair I found that a particular line in the phpbb startup is failing:

$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, defined('PHPBB_DB_NEW_LINK') ? PHPBB_DB_NEW_LINK : false);

Easy fix, I need to configure my DB properties properly.

However, to find that I had to insert echo '1' statements block by block throughout the first couple files of the php app. Prior to the echo statements, I'd get just a blank page, with status 200, when php errored out.

I've turned on both log_errors and display_errors in FPM's php.ini, but apparently they don't do anything with this particular type of error.

There are no logs about the error in /var/log/syslog, /var/log/nginx/*, /var/log/php-fpm.log, or the error log for the nginx site.

So, my question: why is the actual error (from sql_connect) not being logged anywhere? (Alternately, if it is being logged, where?)

7
  • Did you restart both php-fpm and nginx after editing configurations ? Commented Jul 14, 2013 at 22:12
  • @JohnWHS Yeah I've been consistently restarting them after making edits. Commented Jul 14, 2013 at 23:49
  • did you check the error_log settings inside /etc/php5/fpm/php-fpm.conf ? could be changed from the default path, you said ur error log was php-fpm.log while mine actually is php5-fpm.log Commented Jul 15, 2013 at 0:12
  • @MohammadAbuShady thanks - yeah I tried leaving them default (commented out) and setting them to a specific file name. Neither worked so far Commented Jul 15, 2013 at 0:55
  • What version of phpbb and what file is this? Quite possible the errors are being suppressed. Commented Jul 16, 2013 at 6:45

2 Answers 2

5

search for catch_workers_output in your pool and set it to yes, from the doc:

 catch_workers_output - Redirect workers' stdout and stderr into main error log. If not set, they will be redirected to /dev/null, according to FastCGI specs. Values "yes" or "no" 

EDIT:

also check you have

php_flag[display_errors] = on

and/or

php_admin_flag[log_errors] = true
Sign up to request clarification or add additional context in comments.

4 Comments

Wow that's a dumb default. Thanks - that was inevitably part of the issue (and/or would have tripped me up later.) However, still no joy (after restarting).
thanks, the edit made no difference either. I don't understand why the edit is necessary assuming that log_errors is turned on in php.ini, but in any case setting it didn't yield the log anywhere. I should also mention that if I turn display_errors on, this particular error doesn't get displayed either -- I guess that's consistent with the error occurring in a particular worker and not being routed correctly.
On line 100 of common.php is the code: set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler'); If I comment that out, trigger_error before the sql connect statement shows up. The sql connect error still does not show up anywhere.
phpbb has its own error handling features, from the doc somewhere I read "The Error Log is created automatically inside the /store/ directory, and will be called php_error.log ", check there or try to set DEBUG True in your config.php.
1

I had a similar problem today. What I discovered is that the permissions for my log file were incorrect. Ownership was assigned to root. I did a chmod 777 php5-fpm.log to confirm that was the issue and it was. Logging worked after that.

I did a chown syslog:adm php5-fpm.log to set the correct ownership.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.