PHP < 5.2.0 - No files created since update to 6.x-1.0-beta1 due to missing error_get_last()
XerraX - June 2, 2009 - 23:25
| Project: | Boost |
| Version: | 6.x-1.0-beta1 |
| Component: | PHP compatibility |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | duplicate |
Description
Since i updated to 6.x-1.0-beta1 there were no files created in my cache/www... folder. admin/reports/status reports boost is setup correct.
i am using the new boosted2.txt like i did before in 6.x-1.0-alpha4
My configuration:
Drupal/6.12
Apache/2.2.11
MySQL-Database/5.1.33
PHP/5.2.9
Windows Server 2008 Build 6001 (Service Pack 1)

#1
Do you have any errors or drupal messages that show up on your page?
#385924: Don't cache pages when there are PHP/MySQL errors
To test run this in a php code block
<?phpif ($error = error_get_last()){
echo 'errors:' . $error['type'] . ' ';
}
echo 'messages:' . count(drupal_get_messages(NULL, FALSE)) . ' ';
echo 'boost_is_cacheable():' . boost_is_cacheable($GLOBALS['_boost_path']);
?>
It should output messages:0 boost_is_cacheable():1 if its working correctly.
#478306: front page not cached
#2
There were no errors in drupal log or in apache logs and the pages were displayed fine.
I will test the code-block later this day.
#3
error_get_last() is reported as a PHP fatal error for undefined function for PHP 5.1 CentOS. Commenting out that bit of code in boost.module takes care of not serving pages here.
#4
Thanks for the heads up http://us3.php.net/error_get_last php 5.2 and up support it; I need to wrap it around a function_exists().
#5
#6
last one was bad forgot the () for the if statement.
#7
the block says:
errors:2048 messages:0 boost_is_cacheable():1
I disabled the error_get_last stuff temporary, server is now serving the cached sites without problems.
where do i look for the error type?
#8
@XerraX
http://us3.php.net/manual/en/errorfunc.constants.php#errorfunc.constants...
PHP is nagging that somewhere in the code base your using some deprecated functions. I should probably make this (halt on error_get_last()) a setting on the performance page so pages can still be cached even if PHP is throwing dumb errors like this.
While you have that error would you mind running this PHP code block for me
<?php
$error = FALSE;
if (function_exists('error_get_last')) {
$error = error_get_last();
}
$drupal_msg = count(drupal_get_messages(NULL, FALSE));
if ($error || $drupal_msg != 0) {
$ttl = boost_file_get_ttl(boost_file_path($GLOBALS['_boost_path']));
$output = t('There are <strong>php errors</strong> or <strong>drupal messages</strong> on this page, preventing boost from caching.');
if ($error){
$output .= t(' ERRORS: <pre>%error</pre>. %link', array('%error' => print_r($error, TRUE), '%link' => l(t('Lookup Error'), 'http://php.net/errorfunc.constants')));
}
if ($drupal_msg != 0) {
$output .= t(' MESSAGES: %msg', array('%msg' => $drupal_msg));
}
}
?>
It should give you nicer looking output.
#9
Moving since this is the root issue
#385924: Don't cache pages when there are PHP/MySQL errors