skip to Main Content
+971 55 881 1725 hmimthiaz @

Upgrading RAM for my 27 inch iMac mid 2011

I had 4GB RAM which was the default when I bought the mac. After upgrading to Mac OS Lion I really needed more memory, Especially when I am working with Xcode. Local cost was around AED 580 (160 USD) for 2X4GB. Next option was to check online and Amazon came to rescue. Cost for 2X4GB was USD 43 international shipping cost was USD 42. Got greedy and ordered 4X4GB. Posting few pictures I took while changing the RAM….

Buy: Kingston ValueRAM 8GB 1333MHz DDR3 Non-ECC CL9 SODIMM

Help: Installing iMac Intel 27″ EMC 2429 RAM

Free 2GB online storage space – SugarSync

Free 2GB online storage space - SugarSync

Recently I bought an online storage space here at SugarSync.

Here are some of the features

  • Online backup
  • Multi-computer sync (Mac and Windows)
  • Remote access
  • Mobile phone access (iPhone, Blackberry and Windows Mobile)
  • Music & photos
  • Sharing
  • Data security


I am being honest with you. I get bonus space if someone registers using my referral. And if you buy space you might even get upto 10 GB extra. So feel free to try this product. I am sure you will like it 🙂

Click here to register for online space at SugarSync

Leopard + Apache 2 + NTLM + PHP + Integrated Windows Authentication

Everyday we face lot of challenges and today it was to make our CMS work with NTLM(NT LAN Manager Windows authentication protocol) Single Sign-On. I hope you didn’t get any shit what I meant above and so was I when I got the requirement.

In windows network we can connect all computers to a domain and it will have a domain controller. Once your computer is connected to the domain you will be asked enter your domain user name and password when ever you log on to system. After you log in it will use the same credentials to authenticated all the domain related objects like network, files, exchange and so on. In most of the corporations this how they manage the systems with group policies applied to each users.

In Internet explorer there is a feature to use the same credentials to authenticate intranet websites. This is Single Sign-ON. There is very nice article which can help you if you want to set it up.

So my application should be able to detect whether the browser is authenticated already or raise if needed and it will validate the credential with domain controller. There is no direct methods available in PHP to achieve this. So to achieve this I had to rely on NTLM auth module for Apache. It was pretty outdated and Raimonds Simanovskis has updated the source tree and had released a patched version here. I was able to compile it without any issues. Download and extract the files and run this.

#sudo /usr/sbin/apxs -i -a -c mod_ntlm.c
Libraries have been installed in:
chmod 755 /usr/libexec/apache2/
[activating module `ntlm' in /etc/apache2/httpd.conf]

Most important part adding ntlm module to Apache is done. The next step in make some some modification in htaccess file. Configuration setting can be read in detail from here.

AuthName NTAuth
AuthType NTLM
NTLMAuth on
NTLMAuthoritative on
NTLMLockfile /tmp/_my.lck
require valid-user

Make sure that the computer where you have installed apache should be able to connect to domain controller. Always use full domain names and not IP as it will give errors while connecting [reference] . You are fully set now and if everything is correct you will get these variables in PHP with current logged in details.

$_SERVER['REMOTE_USER'] => xxxxx

I have tested this with Internet explorer and it will work without asking password. For other browsers like Firefox, Chrome, Safari it will prompt for authentication. Thats all folks 😉

Compile and install PHP 5.2.8 on Mac OS X 10.5.6 (Leopard)

Due to some limitation I faced with Xampp I finally decided to compile PHP5 native on my mac. Entropy was a best option for mac till Leopard was released. Since Leopard came with php built in entropy was no more available. After Googling for a long time and breaking my head with errors for 7 long hours I finally got it working perfectly like how I wanted it. These are some of the steps I followed to compile the same. I tested the same steps in 2 macs and it was working fine. I cannot guarantee that these steps would work for everyone.

Step 1

You need to have Xcode installed on your mac. In my case I had Xcode 3.1.2 installed. You can install from your Leopard DVD or you can install iPhone SDK.

Step 2

Download and install the latest Mysql database server.

Step 3

Install Fink. You can download the version 0.9.0 which I used for compiling from here. Once you have installed open terminal and issue the following commands.

# sudo fink selfupdate
# sudo fink update-all

The above two commands will update the needed files for fink library to work properly. Once this is done you can install needed libraries for php by issuing the following command

# sudo fink install libjpeg libtiff libpng3 libxml t1lib5 libmcrypt libmhash mysql15-dev curl wget

Step 4

Install FrontBase if it is needed for you. It is installer file you can download it from here. If you don’t want to use this database system you can remove the option ‘–with-fbsql’ from the php configure command.

Step 5

Install Freetds if you want use MS-SQL in PHP5.

# sudo su
# curl -O
# tar xvzf freetds-stable.tgz
# cd freetds-0.82/
# ./configure && make && sudo make install

Incase if you feel this is not needed for your installation you can remove the option ‘–with-mssql’ and ‘–enable-dbase’ from the php configure command.

Step 6

Install Imap Client libraries files. You need this lib to be installed if you wish to compile imap. If you don’t want you can remove the option ‘–with-imap’ and ‘–with-imap-ssl’. Further reading on this topic visit here.

# sudo su
# curl -O
# tar xvzf c-client.tar.Z
# cd imap-2007e/
# make oxp
# cd c-client/
# cp *.h /usr/local/include
# cp *.c /usr/local/lib
# cp c-client.a /usr/local/lib/libc-client.a

Step 7

Install gettext. This is a must for lot of open source projects and for localization.

# sudo su
# curl -O
# tar xvzf gettext-0.17.tar.gz
# cd gettext-0.17
# cd gettext-tools/
# ./configure
# make
# make install

Step 8

Install freetype. You need if you wish to load free type fonts in GD.

#sudo su
# wget
# tar xvzf freetype-2.3.8.tar.gz
# cd freetype-2.3.8
# ./configure
# make
# make install

Step 9

I think we are pretty there and now it is time to compile the big boss the PHP itself.

# sudo su
# wget
# tar xvzf php-5.2.8.tar.gz
# cd php-5.2.8
# ./configure --prefix=/usr/local/php5.2.8 --with-apxs2 --with-config-file-scan-dir=/usr/local/php5.2.8/php.d --with-openssl=/usr --with-zlib=/usr --with-gd --enable-gd-native-ttf --with-jpeg-dir=/sw --with-jpeg-dir=/sw --with-png-dir=/sw --with-zlib-dir=/usr --with-ldap --with-xmlrpc --with-iconv-dir=/usr --with-snmp=/usr --enable-exif --enable-soap --enable-ftp --enable-sockets --enable-mbstring --enable-calendar --enable-bcmath --with-bz2=/usr --with-curl --with-kerberos=/usr --with-libxml-dir=/sw --with-xsl --with-t1lib=/sw --with-mcrypt=/sw --with-mhash=/sw --with-mysql=/sw --with-mysqli --with-pdo-mysql=/sw --enable-zip --with-imap --with-imap-ssl --with-gettext --with-curl=/sw --with-pear --with-regex --with-freetype-dir=/usr/local --enable-gd-native-ttf --with-iconv=shared,/opt/local --enable-dbase --enable-sqlite-utf8 --with-fbsql
# make
# make install

If you have completed till the above step without any error means that you have successfully installed PHP5. If you restart your apache server from system settings the server might not work for you. Since it might conflict a bit due to various architecture problems in apache and php build. To over come this issue you need to re-compile apache. You can do it by issuing the following commands. Further reading on this issue.

Step 10

Recompile Apache 2.

# sudo su
# wget
# tar xvzf httpd-2.2.11.tar.gz
# cd httpd-2.2.11/
# ./configure --enable-layout=Darwin --enable-mods-shared=all
# make
# make install


Once everything is done you should be able to run PHP. Have fun compiling your own native PHP on your mac 😉 .!!!

Back To Top