Undefined functions (Apache errors) just showed up, and how to fix it


#1

It appears that the migration to the new East Coast servers caused an issue where PHP 5.3 on my server had no configuration file, so many of the common modules (mysql, session, etc) were not loaded and instead of seeing my Drupal site I saw an error message (like “undefined function session_name()”). I put in a support request (#5510564) and hope that someone will reinstall the apparently missing PHP 5.3 configuration file (there are no files in /etc/php53), but until then, here’s a workaround for anyone else with the same problem:

mkdir -p ~/.php/5.3
cd ~/.php/5.3
cat > phprc
extension = session.so
extension = mysql.so
extension = bcmath.so
extension = calendar.so
extension = calendar.so
extension = ctype.so
extension = curl.so
extension = dom.so
extension = exif.so
extension = gd.so
extension = gettext.so
extension = hash.so
extension = iconv.so
extension = imap.so
extension = json.so
extension = mcrypt.so
extension = mhash.so
extension = zlib.so[/quote]
CTRL-D

Those modules may be more or less than required to get the system up and working for others. In the DreamHost dashboard -> Manage Domains -> ‘edit’ button for your domain, you can run PHP 5.2 and then create a file with just “<?php phpinfo(); ?>” in your root web directory and visit that page to see what modules are working in 5.2, then enable them by listing them as an extension in the phprc file as I’ve done, above, and finally switch back to running PHP 5.3 in the Dreamhost dashboard again. If you need to edit the phprc file later, run ‘killall -9 php53.cgi’ after each edit.

Read more:

‘MediaWiki and session_name()?’ notes missing configuration file:

Restarting after config changes:


#2

That’s some fairly serious missing bits! I’d be requesting a server move in case anything else is mis-configured on that one.