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

Web hosting discussion, programming, and shared and dedicated servers.
2 posts Page 1 of 1
by pb@sonic.net » 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
by joemuller » Mon May 20, 2013 10:03 am
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
I'm a proud employee of Sonic.net! :-)
2 posts Page 1 of 1

Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests (based on users active over the past 5 minutes)
Most users ever online was 999 on Mon May 10, 2021 1:02 am

Users browsing this forum: No registered users and 2 guests