fintanr's weblog

Archives

« July 2005 »
MonTueWedThuFriSatSun
    
1
2
3
6
7
8
9
10
11
12
13
14
16
17
18
19
20
21
22
23
24
25
26
28
29
30
31
       
Today

the links




Twitter Updates

    follow me on Twitter
















    20050704 Monday July 04, 2005

    PHP, mysqli, Solaris 10 and how not to cause yourself pain...
    Its been quite some time since I've had a reason to handroll a php module (well actually its been quite some time since I've used php, but thats a different matter). Anyway I spent some time last week with a customer who is deploying a apache/mysql/php app on some v20z's running Solaris 10. Now they are very recent converts to Solaris, and the app has been in development for six or seven months, and as such it was developed on a Linux box, with very regular revs of php and mysql.

    So in order to make the overall migration as easy as possible it was decided to use the same version numbers of the various components on Solaris as on the Linux box, giving us Apache 1.3.33, Mysql 4.1.12 and PHP 5.0.4. So we went forth and got the source, and started to compile, and things went south in a very self inflicted manner. Basically due to not reading up on the latest versions of php and mysql on my part we ended up doing a bunch of unneccesserary compiles, and a php module which had no interest in linking to anything,

    Anyway as I said this was self inflicted, and the correct (and easiest) thing to do on Solaris 10 is the following.

    • Download the MySQL 4.1.12 package for s10 on amd64 from the mysql site.
      This will just make your life easier in the long run.
    • Grab your php 5.0.4 Source
    • Pkgadd the mysql package (pkgadd -d unarchived-pkg)
      In our case we symlinked it to /usr/mysql
    • Use the bundled apache software (do a pkginfo -l SUNWapchr to confirm the version info)
    • Compile php (taking note of the mysqli extensions)[1] with
      	# add /usr/sfw/bin for gcc, /usr/ccs/bin for make
      	#
      
           PATH=$PATH:/usr/sfw/bin:/usr/ccs/bin; export PATH
           ./configure --with-apxs=/usr/apache/bin/apxs \
                       --with-mysqli=/usr/mysql/bin/mysql_config \
                       --with-mysql=/usr/mysql
           make; make install
      
    Your httpd.conf needs an AddType for your php extension added in as well.

    [1] This is what had caught me, not following php development that much, I wasn't aware of the mysqli interface. The moral of the story, spend fifteen minutes testing stuff before visiting a customer, even if you set up a similar config in the distant past.

    Technorati Tag(s) :

    (2005-07-04 06:34:51.0) Permalink Comments [3]