Welcome Guest, Not a member yet? Register   Sign In
CI Captcha and image_lib not working on GoDaddy but work on MAMP
#1

[eluser]arylaarsdam[/eluser]
Please forgive me if I fail to use proper terminology. I have developed a site on MAMP using CodeIgniter. The site works perfectly on localhost but when I move it over to GoDaddy VPS two things don't work properly and I'm quite sure they are related issues. Both issues involve pictures generated by CodeIgniter not being created. I do not get any errors of any sort, the images are just not created when I try to run on GoDaddy.

When I first loaded the site to my GD server I had to modify my .htaccess file in order to load anything other than index.php. I modified .htaccess to:
Code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1 [L]

I mention the .htaccess file because in all my research today trying to figure out how to resolve this issue, .htaccess is mentioned often. My site is located in a folder in the web root called '2013Dev'. I tried to add this line to the .htaccess file
Code:
RewriteBase /2013Dev
but that popped an error when I tried to load a page other than index.php.
Quote:[an error occurred while processing this directive]
Please let me know if there is an issue I still have with my .htaccess file.

My code for building a CAPTCHA image is
Code:
$this->load->helper('captcha');
  
  $this->load->model('site_model');
  $randomword = $this->site_model->read_randomword();
  $someword = $randomword['word'];
  
  $captcha = array(
      'word'   => $someword,
      'img_path'  => './captcha/',
      'img_url'  => base_url().'captcha/',
      'font_path'  => './assets/fonts/ArialBold.ttf',
      'img_width'  => '250',
      'img_height' => '50',
      'expiration' => '3600'
  );
  
  $captcha = create_captcha($captcha);
  
  $captchadata = array(
   'captchaword' => $captcha['word'],
   'captchaimage' => $captcha['time'].'.jpg'
  );
  
  $this->session->set_userdata($captchadata);

And here is an example of code that I have that modifies a picture that is uploaded:
Code:
$config2 = array(
     'source_image' => $image_data['full_path'],
     'new_image' => $uploadpath.'/gallery',
     'maintain_ratio' => TRUE,
     'width' => 200,
     'height' => 200,
     'master_dim' => 'height'
    );

    $this->image_lib->initialize($config2);    
    $this->load->library('image_lib', $config2);
    $this->image_lib->resize();
    $this->image_lib->clear();

So yeah, basically when this code runs, nothing happens. Images are not generated and placed in their proper folders (I place CAPTCHA images in a folder called 'captcha' which is at the root level of my CodeIgniter files, same level as the 'application' and 'system' folders, I place generated thumbnail images in a folder called 'uploads/thumbs' at that same root level).

First I thought that it might be a permissions issue on GoDaddy so I opened this folders up temporarily to full access (777) but that still didn't do anything.

Anybody have any ideas or run into this before with GoDaddy? Does this have anything to do with this issue that GD just recently posted regarding .htaccess? Issues with Server-Side Includes and .htaccess Files
#2

[eluser]skunkbad[/eluser]
Godaddy is not the worst host I have ever used, but they are second on my list. At one point I had a technical support issue that I was able to prove was a problem with their server, they agreed, and then said they wouldn't do anything about it. When calling for technical support, they treat us like we are idiots, and by default blame us for our code. If you called them now, that's what they would tell you, but they won't be able to offer any advice, or give you any information regarding why their server setup is different. I think the truth is that they don't really know. In short, get a real host. If Godaddy is your client's hosting, make sure you always add a sufficient amount of dollars to their estimate for covering time lost to Godaddy BS. You might also try to convince them to move to a real host. I like MDD Hosting.
#3

[eluser]arylaarsdam[/eluser]
Thank you for the recommendation on hosting. I need to stick with GoDaddy for the time being. So, does anyone have any suggestions on how to get CI image creation to work on GoDaddy server? Is it a PHP setting I'm missing or an issue with folder permissions or the .htaccess file?

The reason I say this has to do with how CI creates images is because with CAPTCHA, that's what CI is doing with the word provided to it, it build s an image. Same thing really with resizing an image, CI is building the image based on the uploaded image and the dimensions provided to it. What could be causing just this part of CI to fail on GoDaddy? Anyone have any ideas?
#4

[eluser]arylaarsdam[/eluser]
I figured out the source of the problem. GoDaddy did not have the GD Library enabled in the default Apache/PHP setup. The GD Library is needed for both CAPTCHA and Image_lib in CodeIgniter (at least the way I am using image_lib on my site). I followed the instructions on http://forums.cpanel.net/f5/how-install-...27773.html to understand how to enable GD on my GoDaddy VPS. Now I'm good to go.




Theme © iAndrew 2016 - Forum software by © MyBB