<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Börngen-Schmidt IT Consulting &#187; mySQL</title>
	<atom:link href="http://www.boerngen-schmidt.de/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.boerngen-schmidt.de</link>
	<description>Die Summe der Kleinigkeiten ergibt das Ganze.</description>
	<lastBuildDate>Mon, 07 Nov 2011 20:00:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>PHP 5.3 &amp; mySQL auf Mac OS X installieren</title>
		<link>http://www.boerngen-schmidt.de/2008/10/php-53-mysql-auf-mac-os-x-installieren/</link>
		<comments>http://www.boerngen-schmidt.de/2008/10/php-53-mysql-auf-mac-os-x-installieren/#comments</comments>
		<pubDate>Mon, 13 Oct 2008 12:57:31 +0000</pubDate>
		<dc:creator>Benjamin</dc:creator>
				<category><![CDATA[Macintosch]]></category>
		<category><![CDATA[mySQL]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.boerngen-schmidt.de/?p=91</guid>
		<description><![CDATA[PHP im Apache aktivieren PHP 5.2.6 wird standartmäßig mit OSX Leopard ausgeliefert. Damit der lokale Apache PHP nutzen kann muss dieses noch nachträglich in der /etc/apache2/httpd.conf aktiviert werden. Dies geschiet dadurch, dass man die # vor LoadModule php5_module libexec/apache2/libphp5.so wegnimmt. Nun noch die Konfigurationsdatei von PHP kopieren und den Apache Webserver neustarten. sudo cp /etc/php.ini.default <a href='http://www.boerngen-schmidt.de/2008/10/php-53-mysql-auf-mac-os-x-installieren/'>[...]</a>


Keine verwandten Artikel gefunden.]]></description>
			<content:encoded><![CDATA[<h3>PHP im Apache aktivieren</h3>
<p>PHP 5.2.6 wird standartmäßig mit OSX Leopard ausgeliefert. Damit der lokale Apache PHP nutzen kann muss dieses noch nachträglich in der <strong>/etc/apache2/httpd.conf</strong> aktiviert werden. Dies geschiet dadurch, dass man die <strong>#</strong> vor <strong>LoadModule php5_module libexec/apache2/libphp5.so</strong> wegnimmt. Nun noch die Konfigurationsdatei von PHP kopieren und den Apache Webserver neustarten.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>php.ini.default <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>php.ini
<span style="color: #c20cb9; font-weight: bold;">sudo</span> apachectl restart</pre></div></div>

<h3>MySQL installieren</h3>
<p>Die Installation von MySQL gestaltet sich relativ einfach. Einfach unter <a title="MySQL Installations Dateien" href="http://dev.mysql.com/downloads/mysql/5.0.html#macosx-dmg" target="_blank">http://dev.mysql.com/downloads/mysql/5.0.html#macosx-dmg</a> das richtige Packet herunterladen, mounten, installieren und fast fertig. Ich habe mich für die x86_64 Variante entschieden, da mein Core2Dou ja ein &#8220;64bit&#8221; Prozessor ist.</p>
<p>Nach der Installation dann noch einen Doppelklick auf <strong>MySQL.prefpane </strong>um MySQL dann später bequem aus den Systemeinstellungen starten zu können.</p>
<p>Um die MySQL Installation abzuschießen kopieren wir noch die Konfigurationsdatei nach /etc.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>support-files<span style="color: #000000; font-weight: bold;">/</span>my-small.cnf <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>my.cnf</pre></div></div>

<p>Man kann sicherlich auch eine andere cnf wählen, aber da es sich nur um eine lokale Entwicklungsumgebung handelt, sollte die small Konfiguration ausreichen.</p>
<p>Nun ist MySQL installiert und bereit gestartet zu werden. Dies wir einfach über die Systemeinstellungen -&gt; MySQL gemacht. Wer den MySQL Server automatisch starten möchte kann dies dort durch setzen des Harkens bei Autostart erledigen.</p>
<h3>PHP 5.3 installieren</h3>
<p>Nach der MySQL Installation kann man PHP 5.2.6 mit MySQL benutzen, wem das genügt der kann hier nun aufhören zu lesen und sich ans entwicken machen.</p>
<h4>Vorbereitungen</h4>
<p>Nun gut: Here we go, bleeding edge of PHP.<br />
Zur Vorbereitung benötigen wir ein Leopard PHP Packet von entropy.ch und die <a title="Apple Xcode" href="http://developer.apple.com/tools/xcode/" target="_blank">Xcode Tools</a> von Apple. Das aktuellste entropy.ch Packet, welches ich beim schreiben des Artikels gefunden habe, ist Version 5.2.5-6-beta. Wichtig sind für uns allerdings nur die Bibliotheken des Packetes.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #660033;">-s</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span>
curl <span style="color: #660033;">-O</span> http:<span style="color: #000000; font-weight: bold;">//</span>www2.entropy.ch<span style="color: #000000; font-weight: bold;">/</span>download<span style="color: #000000; font-weight: bold;">/</span>php5-5.2.5-<span style="color: #000000;">6</span>-beta.tar.gz
<span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xzvf</span> php5-<span style="color: #000000; font-weight: bold;">*</span>-beta.tar.gz</pre></div></div>

<p>Nun laden wir uns einen <a href="http://snaps.php.net/">Snapshot</a> von PHP 5.3 herunter und entpacken dann auch diesen in /usr/local und wechseln in das Verzeichnis.</p>
<h4>Compilen von PHP</h4>
<p>Kommen wir nun zum Compilen von PHP. Als erstes benötigen wir ein <em>Configure Command</em>, welches wir der einfachheit halber aus dem Entropy.ch Packet übernehmen.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>php5<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>php <span style="color: #660033;">-i</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">&quot;Configure Command&quot;</span></pre></div></div>

<p>Nun müssen wir noch das richtige <strong>&#8211;prefix</strong> und <strong>&#8211;with-config-file-scan-dir</strong> setzen. (Achtung nicht die Pfade zu den Bibliotheken verändern!). Ein fertiges Configure Command könnte dann so aussehen:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">CFLAGS</span>=<span style="color: #ff0000;">&quot;-arch x86_64 -I/usr/local/php5/include/&quot;</span> <span style="color: #007800;">LDFLAGS</span>=<span style="color: #ff0000;">&quot;-L/usr/local/php5/include/&quot;</span> .<span style="color: #000000; font-weight: bold;">/</span>configure  \
<span style="color: #ff0000;">'--prefix=/usr/local/php5.3'</span> \
<span style="color: #ff0000;">'--with-apxs2=/usr/sbin/apxs'</span> \
<span style="color: #ff0000;">'--with-config-file-scan-dir=/usr/local/php5.3/php.d'</span> \
<span style="color: #ff0000;">'--with-openssl=/usr'</span> \
<span style="color: #ff0000;">'--with-zlib=/usr'</span> \
<span style="color: #ff0000;">'--with-zlib-dir=/usr'</span> \
<span style="color: #ff0000;">'--with-gd'</span> \
<span style="color: #ff0000;">'--with-ldap'</span> \
<span style="color: #ff0000;">'--with-xmlrpc'</span> \
<span style="color: #ff0000;">'--enable-exif'</span> \
<span style="color: #ff0000;">'--enable-soap'</span> \
<span style="color: #ff0000;">'--enable-sqlite-utf8'</span> \
<span style="color: #ff0000;">'--enable-wddx'</span> \
<span style="color: #ff0000;">'--enable-ftp'</span> \
<span style="color: #ff0000;">'--enable-sockets'</span> \
<span style="color: #ff0000;">'--with-bz2=/usr'</span> \
<span style="color: #ff0000;">'--enable-zip'</span> \
<span style="color: #ff0000;">'--enable-pcntl'</span> \
<span style="color: #ff0000;">'--enable-shmop'</span> \
<span style="color: #ff0000;">'--enable-sysvsem'</span> \
<span style="color: #ff0000;">'--enable-sysvshm'</span> \
<span style="color: #ff0000;">'--enable-sysvmsg'</span> \
<span style="color: #ff0000;">'--enable-mbstring'</span> \
<span style="color: #ff0000;">'--enable-bcmath'</span> \
<span style="color: #ff0000;">'--enable-calendar'</span> \
<span style="color: #ff0000;">'--with-mhash=shared,/usr/local/php5'</span> \
<span style="color: #ff0000;">'--with-kerberos=/usr'</span> \
<span style="color: #ff0000;">'--with-libxml-dir=/usr/local/php5'</span> \
<span style="color: #ff0000;">'--with-xsl=/usr/local/php5'</span> \
<span style="color: #ff0000;">'--with-gettext=/usr/local/php5'</span> \
<span style="color: #ff0000;">'--with-curl=shared,/usr/local/php5'</span> \
<span style="color: #ff0000;">'--with-png-dir=/usr/local/php5'</span> \
<span style="color: #ff0000;">'--with-jpeg-dir=/usr/local/php5'</span> \
<span style="color: #ff0000;">'--enable-gd-native-ttf'</span> \
<span style="color: #ff0000;">'--with-freetype-dir=/usr/local/php5'</span> \
<span style="color: #ff0000;">'--with-mysql=mysqlnd'</span> \
<span style="color: #ff0000;">'--with-mysqli=mysqlnd'</span> \
<span style="color: #ff0000;">'--with-pdo-mysql=mysqlnd'</span> \
<span style="color: #ff0000;">'--with-pgsql=shared,/usr/local/php5'</span> \
<span style="color: #ff0000;">'--with-pdo-pgsql=shared,/usr/local/php5'</span> \
<span style="color: #ff0000;">'--with-mcrypt=shared,/usr/local/php5'</span> \
<span style="color: #ff0000;">'--with-iconv'</span> \
<span style="color: #ff0000;">'--without-pear'</span></pre></div></div>

<p>Der -arch Parameter bei CFLAGS kann auch weggelassen werden, er deutet nur an für welche Architektur PHP compiled wird. Wer noch weitere Optionen für PHP aktivieren will, der kann sich mit</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--help</span></pre></div></div>

<p>einen Überblick über die Optionen verschaffen.</p>
<p>Nachdem der Configure Command ohne Probleme durchgelaufen ist, kommt nun ein gepflegtes</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #660033;">-j4</span></pre></div></div>

<p>und wir holen uns erstmal einen Kaffe.</p>
<h4>Post make</h4>
<p>Nachdem make durchgelaufen ist müssen wir noch etwas an den dynamischen Links von PHP ausbesseren. Um sich die dynamischen Links anzeigen zu lassen kann otool verwendet werden.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># show dynamic links</span>
otool <span style="color: #660033;">-L</span> libs<span style="color: #000000; font-weight: bold;">/</span>libphp5.so
&nbsp;
<span style="color: #666666; font-style: italic;"># correct linking</span>
install_name_tool <span style="color: #660033;">-change</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libxml2.2.dylib <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>php5<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libxml2.2.dylib libs<span style="color: #000000; font-weight: bold;">/</span>libphp5.so
install_name_tool <span style="color: #660033;">-change</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libxslt.1.dylib <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>php5<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libxslt.1.dylib libs<span style="color: #000000; font-weight: bold;">/</span>libphp5.so
install_name_tool <span style="color: #660033;">-change</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libexslt.0.dylib <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>php5<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libexslt.0.dylib libs<span style="color: #000000; font-weight: bold;">/</span>libphp5.so
&nbsp;
<span style="color: #666666; font-style: italic;"># backup der libphp5.so von leopard</span>
<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>libexec<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>libphp5.so <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>libexec<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>libphp5.so.leopard
&nbsp;
<span style="color: #666666; font-style: italic;"># Installation der neuen PHP version</span>
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #7a0874; font-weight: bold;">test</span>
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Kopieren des neuen Apache Modules in unser Standalone Packet</span>
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>libexec<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>libphp5.so <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>php5.3</pre></div></div>

<h4>Abschließende Konfiguration</h4>
<p>So und fertig ist die Installation von PHP 5.3 unter Mac OS X. Einen letzter Feinschliff muss jedoch noch an der Installation durchgeführt werden. Dies aber nur schnell Stichpunkt artig.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cp</span> php.ini-recommended <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>php5.3<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>php.ini
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>php5.3<span style="color: #000000; font-weight: bold;">/</span>php.d
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>php5<span style="color: #000000; font-weight: bold;">/</span>php.d<span style="color: #000000; font-weight: bold;">/*</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>php5.3<span style="color: #000000; font-weight: bold;">/</span>php.d
<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/php5/php5.3/g'</span> <span style="color: #660033;">-i</span> <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>php5.3<span style="color: #000000; font-weight: bold;">/</span>php.d<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">10</span>-extension_dir.ini
<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/20060613/20071006/g'</span> <span style="color: #660033;">-i</span> <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>php5.3<span style="color: #000000; font-weight: bold;">/</span>php.d<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">10</span>-extension_dir.ini
apachectl restart</pre></div></div>

<p>Um PHP nach den eigenen Wünschen zu konfigurieren einfach die entsprechenden Werte in der <strong>/usr/local/php5.3/lib/php.ini</strong> ändern.</p>
<p>Quellen:</p>
<ul>
<li><a title="Womberts Blog" href="http://blog.wombert.de/post/23017941/compiling-php-5-3-in-64-bit-on-os-x-leopard">http://blog.wombert.de/post/23017941/compiling-php-5-3-in-64-bit-on-os-x-leopard</a></li>
<li><a href="http://forge.mysql.com/wiki/PHP_PDO_MYSQLND" target="_blank">http://forge.mysql.com/wiki/PHP_PDO_MYSQLND</a></li>
</ul>


<p>Keine verwandten Artikel gefunden.</p>]]></content:encoded>
			<wfw:commentRss>http://www.boerngen-schmidt.de/2008/10/php-53-mysql-auf-mac-os-x-installieren/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

