CodeIgniter Forums
OS X Leopard and Image_Lib Issue (Solved) - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: OS X Leopard and Image_Lib Issue (Solved) (/thread-13303.html)



OS X Leopard and Image_Lib Issue (Solved) - El Forum - 11-17-2008

[eluser]Adin[/eluser]
The following is an account of my experience setting up OS X 10.5.x to work with CodeIgniter 1.7.0. My issue was that some of the Image_Lib functions where returning errors.

PLEASE NOTE: There were no CodeIgniter Bugs related to this issue, all problems you experience with OS X Leopard are related to your apache and php environment.

The Basics:
OSX 10.5.x's Apache Server and PHP engine are compiled to run 64bit. So if you're running a new Machine that is 64bit (Core 2 Duo) then problem stems from the fact that GD and other plugin libraries for PHP are only 32bit and they wont run.

I had just installed Freakauth and was having problems displaying the captcha image.
I saw the error occurring when in Image_Lib.php in function image_create_gd($path = '', $image_type = '') where it checks:
Code:
if ( ! function_exists('imagecreatefromjpeg'))

THE Solution:
The solution isn't pretty, but it works... it requires:
- stripping out 64 bit support for your apache server
- compiling the latest version of PHP (5.2.6) for 32bit
- compiling and installing the JPEG, PNG and FREETYPE Libraries with MacPorts

After doing all of the above steps I still had an issue where the page was returning blank and my Apache log displayed the following error:
Quote:__THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__
() to debug.
Which lead to the last step:
- fix the MacPorts "freetype" problem (allows the PHP command 'imagettftext' to work)

Instructions
To do this you MUST follow the instructions provided by the 2 links below carefully.
You need the following
-root/su user access through terminal
-you need to install XCode (Came with your Leopard Install Disc)
-you need to install X11 SDK (Also on the Install Disc)

I recommend Following the same tutorials that i found online

Apache 32bit and PHP Compile Instructions

MacPorts Freetype Fix


Hope this helps


OS X Leopard and Image_Lib Issue (Solved) - El Forum - 12-17-2008

[eluser]Adin[/eluser]
So I just upgraded from OSX 10.5.5 to 10.5.6 and my localhost stopped working...

Turns out Apple OS update breaks the apache php config.

-Apache server is back to 64 bit and needs to be stripped again to use 32bit.
-/etc/apache2/httpd.conf has a new php module entry that should be removed.


OS X Leopard and Image_Lib Issue (Solved) - El Forum - 12-18-2009

[eluser]Matt Egan[/eluser]
Well, I'm glad I've found my problem, I've been sitting here pulling my hair out wondering why image_lib wasn't working the way I expected it. You've got to be kidding me.

I wonder if there's any easy way to do this without messing up my installation of MAMP... Hmm.