Showing posts with label osx. Show all posts
Showing posts with label osx. Show all posts

Thursday, 6 November 2008

iconv will not link when compiling PHP on OSX

When trying to compile PHP on OSX Leopard, the ./configure command completed successfully but iconv would not link....

Undefined symbols:
"_iconv_close", referenced from:
_php_iconv_string in iconv.o
_php_iconv_string in iconv.o
__php_iconv_strlen in iconv.o
__php_iconv_strpos in iconv.o
__php_iconv_mime_decode in iconv.o
__php_iconv_mime_decode in iconv.o
__php_iconv_mime_decode in iconv.o
_zif_iconv_substr in iconv.o
_zif_iconv_substr in iconv.o
_php_iconv_stream_filter_dtor in iconv.o
_zif_iconv_mime_encode in iconv.o
_zif_iconv_mime_encode in iconv.o
"_iconv_open", referenced from:
_php_iconv_string in iconv.o
__php_iconv_strlen in iconv.o
__php_iconv_strpos in iconv.o
__php_iconv_mime_decode in iconv.o
__php_iconv_mime_decode in iconv.o
_zif_iconv_substr in iconv.o
_zif_iconv_substr in iconv.o
_zif_iconv_mime_encode in iconv.o
_zif_iconv_mime_encode in iconv.o
_php_iconv_stream_filter_factory_create in iconv.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1

I believe this is a problem with the default /usr/include/iconv.h header file in Leopard.

I have a different version of iconv.h installed with Fink which puts all it's software in /sw
I added the following to the ./configure command's options, as suggested here.

--with-iconv=shared,/sw


This would not work unless 'shared' is specified. Perhaps this is because Fink compile iconv as a shared library.

Wednesday, 5 November 2008

Broken Web Sharing / Apache on OSX Leopard

I recently installed Leopard on my macbook and wanted to enable Web Sharing but when I visited http://localhost, Firefox gave me the following error:
Failed to Connect
Firefox can't establish a connection to the server at io.
I tried to uncheck/check Web Sharing in System Preferences. I also tried stopping/starting Apache on the command line with no luck.

Finally I used this resource on DIYMacServer to reinstall Apache on my machine. It now works like a charm, thanks Richard!

(This all came about because I want to install SilverStripe which suggests using MAMP, but I did not want multiple versions of Apache installed on my machine.)

Monday, 9 July 2007

ssh segmentation fault osx

Argh!! Every time I install an update on my MacBook it breaks ssh. Up until now I'd been using Pacifist to extract & reinstall the Kerberos Framework from the 10.4.8 update, as per these instructions.

I'm now having to do this on a regular basis which is very annoying and I'm getting concerned that replacing Kerberos with an older version is introducing security holes. so I've decided to install Fink and openssh instead of using Apple's ssh.

Wednesday, 21 March 2007

Environment Variables in Mac OS X

I've been recently having trouble starting certain java applets on my MacBook. For some reason , once downloaded, the Jar file would not extract or run. After much tinkering I found that the applets would work if I started my browser from the command line rather than the dock.

Similarly I couldn't get certain scripts to work from textmate, but they would work if I started textmate from the command line.

The problem was that the $PATH variable I had set in my .bash_profile was not the same as that set in my ~/.MacOS/environment.plist file.

Certain applications depend on being able to read your PATH and other environment variables. However those set in .bash_profile have absolutely no effect on apps started from the Dock. Instead make sure that the PATH variable in your environment.plist file is in sync with that in your .bash_login by doing 'echo $PATH' in a terminal and copying the result into said file.