Jump to content

Recommended Posts

Hello,

 

I have a script that will resize all images in a directory.. the script functions properly on my normal hosting (through hostgator) but when I try to run the script on a GoDaddy site, the script will only get about half way done and then just stop without any errors.

 

I've checked the max_execution_time and it's set to 90 but the script seems to stop after around 25 seconds.

 

I wrote another script that was just a for loop with sleep(1) to run 90 times and it did without any issues..

 

I was thinking it was a memory error but I don't get any fatal errors saying so...

 

I know its something to do with the config of GoDaddy but I can't figure out the exact cause. the server does have PHP5 installed and the only error i can even get to throw through the GoDaddy logs is a warning about ./json.so not being able to load..

 

 

Can anyone think of anything off the top of their head that could cause this to happen only on GoDaddy?

 

 

this is the gist of the function but its been modified a tiny bit... (only filenames that are created etc)

 

<?php
// The file
$filename = 'test.jpg';

// Set a maximum height and width
$width = 200;
$height = 200;

// Content type
header('Content-type: image/jpeg');

// Get new dimensions
list($width_orig, $height_orig) = getimagesize($filename);

$ratio_orig = $width_orig/$height_orig;

if ($width/$height > $ratio_orig) {
   $width = $height*$ratio_orig;
} else {
   $height = $width/$ratio_orig;
}

// Resample
$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);

// Output
imagejpeg($image_p, null, 100);
?>

 

 

 

 

 

 

thanks!

Link to comment
https://forums.phpfreaks.com/topic/218297-script-on-godaddy/
Share on other sites

in php5.ini I have:

 

error_reporting = E_ALL;

 

 

still no errors :(

 

 

the file destinations isn't an issue the directory and contents is set to 777. The script works perfectly on about half of the images, it just stops before it should... it's like it can't read the full file list? there are about 200 images in the directory and it resizes 90~ each time

 

 

I checked and GD is in PHP

 

GD Support	enabled
GD Version	bundled (2.0.34 compatible)

Link to comment
https://forums.phpfreaks.com/topic/218297-script-on-godaddy/#findComment-1132651
Share on other sites

  • 1 month later...

bumping :(

 

I still never resolved this :(

 

I am 100% sure that it's not my script now...

 

 

How can I make sure that the script has access to all of the files in the folder? There is something wrong with the .htaccess file or something that is preventing the script from seeing all of the files...

 

any ideas?

Link to comment
https://forums.phpfreaks.com/topic/218297-script-on-godaddy/#findComment-1148518
Share on other sites

  • 5 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.