0

I'm trying to use the "SimpleImage.php" library to easily upload files. I've put the SimpleImage.php file into libraries and tried to load it in the following way:

$this->load->library('simpleimage');

This gives me a server-error like so: http://d.pr/i/kT7W

When i try to include the simpleimage file in a normal way, it gives me the same server error. Any ideas?

Warre Buysse
  • 1,335
  • 4
  • 21
  • 39
  • The server should have a log file that will give you more details about what error occurs. Alternatively, try to activate error reporting: [How to get useful error messages in PHP?](http://stackoverflow.com/q/845021) – Pekka Sep 22 '13 at 13:48
  • This is using a namespace, I don't think its supported in CI, try removing the namespace and see if it works, otherwise just use 'include' as shown in the documentation. – ahmad Sep 22 '13 at 13:56
  • @ahmad it keeps giving quite a lot errors about new notations in php 5.3, and i'm using 5.2. So i guess this is a lost cause. I'll use the native uploader i guess. – Warre Buysse Sep 22 '13 at 14:08
  • What kind of errors exactly? – Pekka Sep 22 '13 at 14:22
  • @WarreBuysse have you tried with namespace removed as I suggested? – ahmad Sep 22 '13 at 15:38
  • @ahmad yes i did, but then it gave an error on a certain "?:" in the following line of code: $height = $height ?: $width; I took a version at Github that was compatible with PHP 5.2, and now it works. Maby not the most proper way to do it, but deadline is within 3 hours, so that's the best solution I guess. – Warre Buysse Sep 22 '13 at 16:10
  • Those can be easily changed to be compatible with older PHP, like this $height = $height ? $height : $width; Glad you found a version that works for you :) – ahmad Sep 22 '13 at 16:13
  • @ahmad agh great, didn't knew what that ?: meant. It would be better to use a newer version of SimpleImage so i'll try to modify the code in it. I'll let you know if it works (tomorrow). – Warre Buysse Sep 22 '13 at 19:31

0 Answers0