0

I tried to copy my site to a new sever and since id did that, I get an HTTP-Fehler 500 (Internal Server Error): on certain pages. The log files are reporting:

PHP Fatal error:  Call to undefined function chdir() in /var/customers/webs/something/includes/bootstrap.inc on line 3384
PHP Fatal error:  Call to undefined function max() in /var/customers/webs/something/includes/lock.inc on line 106

I cleared all caches many times with:

drush cc all

and also flushed the cache tables directly with MySQL commands. I disabled APC. I don't think, that this is a problem with the server, because it serves well for other Durpal sites.

EDIT: Here are my php.ini and htaccess.

  • 1
    Is the new server or vhost in PHP safe mode? What does status report say? – mpdonadio Jun 13 '13 at 1:13
  • What's your php version, by the way? Even in safe mode chdir is defined, so @MPD suggestion does not explain it all - but is a good starting point. And max is plainly safe. – Mołot Jun 13 '13 at 6:48
  • @MPD The server is a vhost and PHP is in safe mode. But the status report does not complain for safe mode restrictions and I get no Drupal error messages either. – user5950 Jun 13 '13 at 8:39
2

chdir() and max() are built in functions that always exists in PHP. They are in no plugin, just a core. Even in safe mode both should be defined.

There is one way to disable them and make them non-existent from the script's point of view. disable_functions section in php.ini does the trick. Usually it is used for safety, like this:

disable_functions=exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source 

and whilst I can see some illusionary* safety in disabling chdir(), disabling max() must have been a mistake. Note that on some configurations you can alter ini settings in .htaccess and via ini_set() too.

*Illusionary due to the same reasons that made Safe Mode deprecated.

  • Thank you for clarify that, but the functions mentioned above are not disabled in php.ini or elsewhere. – user5950 Jun 13 '13 at 8:40
  • @user5950 So what's your PHP version? Anyway if there is safe mode at all, you are using pretty old PHP version. Could you post your php.ini and .htaccess? – Mołot Jun 13 '13 at 8:46
  • PHP Version 5.3.24-1. I posted the files above. – user5950 Jun 13 '13 at 9:39
  • @user5950 nothing that could block these functions there. Weird. Can you output phpinfo() ? – Mołot Jun 13 '13 at 10:08
  • Finally I found the cause of that problem: I get those or similar messages when the server runs out of memory. – user5950 Jul 9 '13 at 12:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.