Page 1 of 1

Using PHP for a website and jpeg files don't/ won't load

Posted: Sat May 18, 2013 4:17 pm
I loaded a website (http://www.gaylebergmann.com) to Sonic that uses PHP. The Home page and Contact page work fine. However, we have some galleries that appear to use the PHP but don't load and leave an error message of " Fatal error: Call to undefined function: scandir()in /nfs/www/WWW_pages/pb/gaylebergmann.com/galleries.php on line 78"

Sonic supports PHP, so I'm at a loss. Our site designer is in Bangkok, so always 12 hours adrift. Anyone have any thoughts on this?

Thanks, Peter

Re: Using PHP for a website and jpeg files don't/ won't load

Posted: Mon May 20, 2013 10:03 am
by joemuller
Peter,

I took a look at your files, and it looks like you'll need to make a quick change to your .htaccess to enable PHP 5. Add the following two lines to the top of your .htaccess in the base directory for your site:

Code: Select all

Action php-cgi /cgi-bin/php53
AddHandler php-cgi .php
The scandir() function appears to only be available in PHP 5 and later, so because Sonic.net's servers default to using PHP 4, the code will produce an error like the one you saw.

Best of luck!

-- Joe