Subscribe to RSS

Posts Tagged web development

Filed under:
Tech Tips by Ares on March, 10

Recompiling PHP5 on Snow Leopard with MySQLi support, and other things

[update 04.05.2010. If you got the OS X 10.6.3 update you may find yourself reading this again since it overwrites your php library. Yes, we found out the hard way. Backup your library first. ]

We just got a new workstation in the office. After getting it out of the box we were happy to realize that it already comes with a much better configuration for php 5.3 than the old 5.2 of OS X Leopard. Leopard only came with a very few and basic configuration and libraries, that were only fit to new web designer. Apparently they noticed this at Apple and this new version comes with a much better library set.

In general we have more than once person developing a site. So we use mysql databases that are hosted in a server that anyone can access, that way when someone makes a change to the databases it is immediately propagated to all developers, since we use something similar to a “networked drive.”

However, MySQL is still not included, but the folks at mysql have created a dmg that allows you to easily install mysql into your computer. You just need to download it, double click, and follow the prompt. The problem is that php comes with a strange version of mysqli. We were all exited and ready to go when:

Warning: mysqli::mysqli() [mysqli.mysqli] OK packet 6 bytes shorter than expected in /path/to/file on line…

mysqlidev won't let you connect to remote servers

This happens because the mysqli API library that php is using is the one that comes by default, not the one from the mysql version we just installed. Shoots, we need to recompile, and since we are at it, we will also recomplile with the new version of jpeglib.

Now it makes sense just to grab the configure options shown by phpinfo, but for some reason it references some locations that do not exists for jpeglib and libpng. So we will need to compile those too. Also make sure to remove your dir path from pcre otherwise it will also trow you and error.

Okay, let’s do this. First we download our source for PHP, LibJPEG, LibPNG

Lets compile libjpeg first: Once you have uncompressed the source, just go into the directory and type in the following

export MACOSX_DEPLOYMENT_TARGET=10.6
 
CFLAGS="-arch x86_64 -Os -pipe -m64" CXXFLAGS="-arch x86_64 -Os -pipe -m64" LDFLAGS="-arch x86_64 -Os -pipe -m64" ./configure --enable-shared

That should finish without problems, now go to your libpng folder and type the following

./configure --enable-shared

Again, it should finish without problems. Do the same for libPNG, and

Now, it would make sense to compile php now, but there are some know bugs in php when compiling on a mac so lets get those corrected first, before we continue.

Fist you will need to modify the file ext/gd/libgd/gd_png.c, so open it with your favorite text editor and look for the following string:

if (!png_check_sig (sig, 8)) { /* bad signature */

and replace it for this other line:

if (!png_sig_cmp (sig, 0, 8) == 0) { /* bad signature */

Now, using your favorite text editor go to the following file within your php source code ext/libiconv/libiconv.c
and look for

#ifdef HAVE_LIBICONV
#define iconv libiconv
#endif

and replace the libconv of the second line for just iconv

Okay, now we are ready to compile php, so go to the the root of your php source code and type in (copy & paste) the following

CGLAGS="-arch x86_64 -Os -pipe -m64" CXXFLAGS="-arch x86_64 -Os -pipe -m64" LDFLAGS="-arch x86_64 -Os -pipe -m64" ./configure '--prefix=/usr' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--disable-dependency-tracking' '--sysconfdir=/private/etc' '--with-apxs2=/usr/sbin/apxs' '--enable-cli' '--with-config-file-path=/etc' '--with-libxml-dir=/usr' '--with-openssl=/usr' '--with-kerberos=/usr' '--with-zlib=/usr' '--enable-bcmath' '--with-bz2=/usr' '--enable-calendar' '--with-curl=/usr' '--enable-exif' '--enable-ftp' '--with-gd' '--with-jpeg-dir=/user/local' '--with-png-dir=/usr/local' '--enable-gd-native-ttf' '--with-ldap=/usr' '--with-ldap-sasl=/usr' '--enable-mbstring' '--enable-mbregex' '--with-mysql=mysqlnd' '--with-mysqli=/usr/local/mysql/bin/mysql_config' '--with-pdo-mysql=mysqlnd' '--with-mysql-sock=/var/mysql/mysql.sock' '--with-iodbc=/usr' '--enable-shmop' '--with-snmp=/usr' '--enable-soap' '--enable-sockets' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--with-xmlrpc' '--with-iconv-dir=/usr' '--with-xsl=/usr' '--with-pcre-regex'

Life is good

Now, go and grab yourself a cup of coffee, this is going to take a while. After that you should be able to connect to any remote mysql server that you have access to.

If you share your workstation with someone else, then it may be a good idea to secure your mysql installation.

Now, in order to make your .htaccess files to work, you need to change your apache user settings. For that you need to go to /etc/apache2/users/USERNAME.conf and make sure it reads something like this
Options Indexes -MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all

You will also need to change the second AllowOverride that you find in your /etc/apache2/httpd.conf

Well, that should do it. So good luck and let us know if you run into any problem.

Tags: , , , ,

Filed under:
Web Design by Ares on August, 09

Olchefski’s Artistic Web Design

Pat's Olchefski site lauch

Pat's Olchefski site lauch

Pat Olchefski-Winston, aka Lady Pearl, is a multi-disiplinary artist, and yoga instructor.

She began her career over 20 years ago, and has shown her work through the US, Mexico, Canada and the Caribbean, and now thanks to his new web design and revamped site, she is able to show, and manage her digital gallery very easy online with the help of our services in web application development.

Click on the image to the right to preview the site, keep clicking and you will be able to see some of her beautiful work.

Do you think that her new design fits her as an artist? Let us know.

Tags: , , , , ,

Filed under:
Web Design by Ares on February, 09

New Web Design for François Modave

Francois New Web Design

Francois New Web Design

Francois Modave is a renowed computer scientist researcher based on Washington State. We had fun while working on his site which mixes is two passions. Computers and Triathlon.

He wanted his web design to be techy, but modern at the same time. He also wanted to be able to modify his site in an easy and simple way so he wouldn’t have to take much of his precious time updating his site so  we set up a web application to just do that. Let’s just hope that he takes care of it.

Oh, and if you are looking for a triathlon coach he is the one!

Tags: , , ,

  • Logo and branding created for Borderpak.
  • We had the priviledge of creating the site for The Official Sunbowl Store
  • The Ranchers Grill New Web Design
  • Logo, Branding and Brochure created for Concrete and Stone countertops
  • HomegrownElPaso.com. We were happy to created the site for such a wonderful organization
  • We were delighted to create the L & J Cafe website