Last 5 comments
31 years ago
Rafael:  Thank you very much, I was having a huge headache to solve the very same problem!
37 years ago
Ray:  Having the same problem. Very frustrating. Luckily, for some reason my released version worked on the iPad itself, but now I can't get it to run in the simulator. Getting no such table, which I'm guessing is an initialization error. Will continue to investigate.
38 years ago
Jeremy:  FYI, I've just tried it with the SQLite 3.7.0 preview and the same problem occurs.
Also, I'm not using any extra third-party libraries with my SQLite, so the problem isn't your Unicode extension.
38 years ago
Jeremy:  I'm having the same problem with compiling SQLite against iOS 4 for the iPad simulator, but in my case it works fine running on an actual iPad (also works in the iPhone simulator and on an iPod Touch).
Same problem with 3.6.23.1, 3.6.23, and at least back to 3.6.21. Compiling against iOS 3.2 makes it work, though that's not really an option for iPhone (as opposed to iPad) apps.
I have no idea what to do about it or how big a problem it really is...
38 years ago
Pascal:  The problem seems to have deep roots, however there is a solution, see the updated post. :)
The archive
March 2011  (1)
July 2010  (1)
July 2009  (1)
March 2009  (1)
July 2008  (3)
June 2008  (1)
May 2008  (3)
March 2008  (1)
July 2007  (1)
June 2007  (3)
May 2007  (1)
April 2007  (1)
July 2006  (2)
June 2006  (6)

Compile Apache 2.2 on Mac OS X

Wednesday, June 7th 2006 - 18:31
When a friend of mine upgraded to the latest Suse distro and along with that (unwillingly) to Apache 2.2.x, an internal website written by me broke. After a short phone call it was clear that this was an Apache-configuration-problem, but that Apache was about 250 km away from my (current) home and behind the firewall of the University; so the only way to tell him which configuration to edit was installing Apache 2.2 on my PowerBook running the Tiger.
I know there are several packages bringing you a whole MAMP system to your Mac, but I wanted to have a standard-install of the Apache, so I decided to compile the latest version from source.
Note: I used a standard Mac OS X 10.4.6 environment with self-compiled MySQL. My Console is the Bash.

Compiling the Apache HTTP server 2.2.2

  • Download the latest Apache source (Unix) from httpd.apache.org/download.cgi
  • unpack the archive (simply by doubleclicking it in the Finder)
  • open the Terminal and navigate to the unpacked folder named http-2.2.x
  • configure the server; I used the following flags which install most modules shipped with Apache2 including mod_rewrite, which I desperately needed:
    $ ./configure --enable-module=most --enable-shared=max --enable-rewrite=shared
  • if there occur no errors install the Apache with $ make && sudo make install
That's it! The interesting stuff now lies here:
Apache-Root: /usr/local/apache2/ Apache-Bin: /usr/local/apache2/bin/httpd Apache-Config: /usr/local/apache2/conf/httpd.conf
Since this installs the Apache2 beneath the already installed Apache 1.3 (shipped with every Mac OS X), I decided I want to control the Apple-Apache from the SystemPrefs > Sharing and the newly installed Apache2 from the Terminal (Bash). So I prepended the path to the httpd to my existing PATH-variable.
$ PATH=/usr/local/apache2/bin:$PATH $ export PATH

Ajdusting httpd.conf

After that, I slightly modified the httpd.conf. The first line tells the Apache2 to use the same root-directory as the standard Apache, so my websites can stay where they are and everything should run like it always has. Second line tells him to listen to port 8080 and third line enables my beloved mod_rewrite. The last three lines set the Script-dir to the same one used by the default Apache. (Do not forget to change the <Directory>–tags to the appropriate paths as in line 1 and 5)
1: DocumentRoot /Library/WebServer/Documents 2: Listen 8080 3: LoadModule rewrite_module modules/mod_rewrite.so 4: <IfModule alias_module> 5: ScriptAlias /cgi/ "/Library/WebServer/CGI-Executables/" 6: </IfModule>

Then check the config and start your new Apache if no error occurs:
$ sudo apachectl configtest $ sudo apachectl start

That was it and I was happy to see that all my Perl-websites (including those using MySQL) were still up and running. And after restarting my PowerBook, I realized the server has started automagically; looks like it saves its state across reboots and you do not need to install any Login-Items.
That's all great, but two problems emerged...
  • PHP code does not work; see below
  • some .htaccess files became illegal. That is a minor problem though; I had to delete all entries specifying an error-document and: Problem solved

The issue with PHP is that the PHP-module from the old Apache cannot be used by Apache 2, so on this occasion, I decided to finally upgrade to PHP 5.x by compiling it from source...

Compiling PHP 5 from source

  • Download latest PHP 5 source from www.php.net/downloads.php
  • unpack the downloaded archive (easiest is doubleclicking it in the Finder)
  • configure PHP like so:
    $ ./configure --quiet --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-zlib-dir=/usr/local/lib --enable-mbstring --with-gd --with-xml

  • Note that for --with-gd to work, you have to install zlib and libpng as written here: paginar.net. If you do not want to do this, just omit the --with-zlib-dir and --with-gd part and PHP 5 will compile just fine.
    Note 2: The supplied Apache2- and MySQL-paths above are the paths to the Apache2- and MySQL-root-directory, not the path to the executable!)
    Note 3: If you are on an Intel-Mac, you need to get a configurable version of libpng (as of version 1.2.12) which can be downloaded here. You then need to compile libpng with ./configure --prefix=/usr/local && make && sudo make install. And be sure to read the note about compiling GD on Intel-Macs on the paginar.net website, compiling GD else will fail!)

  • if all went well, finish it with $ make && sudo make install
One last edit to the httpd.conf and your new Apache2 is ready to run PHP-code. That is, load the PHP module:
LoadModule php5_module modules/libphp5.so AddType application/x-httpd-php .php .phtml AddType application/x-httpd-php-source .phps

Restart the Apache:
$ sudo apachectl graceful

Edit: Create a new launchd item to start your new Apache at boot

Well, soon (after publishing this article) I discovered that on a reboot, the built-in Apache will be launched instead of my new Apache 2.2, even if I disabled WebSharing in the System Preferences.
The solution is to disable the original Startup-Item that starts the built-in Apache and create a new launchd-item which tells launchd to start your new Apache.
  • disable the Apache Startup-Item by setting WEBSERVER=-NO- (from -YES-) within /etc/hostconfig
  • create a new launchd-item with Lingon (or another similiar application; this one is Open Source, though, and does a great job) as a user-daemon, or » use mine and put it into /Library/LaunchDaemons/
  • reboot
Here is what my launchd-plist looks like. Note that I gave the server a nice-value of 10 since I dont want the Apache to lock up my computer; I only use my machine for local testing, not real serving.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>org.apache2.httpd</string> <key>Nice</key> <integer>10</integer> <key>ProgramArguments</key> <array> <string>/usr/local/apache2/bin/apachectl</string> <string>start</string> </array> <key>RunAtLoad</key> <true/> </dict> </plist>
TK at 15.06.2006 20:45

I sure would like to know how this worked for you. I have Apache 2.2.2 and PHP 5.1.4 and PHP will NOT compile. A veritable cornucopia of errors. the last ones have all been apache-related.
this is starting to distress me.
Pascal at 16.07.2008 12:23

I just realized that the paginar.net link is dead. I apologize. I will cache in the future. :)
Comments are disabled