{"id":587,"date":"2008-06-04T22:16:54","date_gmt":"2008-06-05T02:16:54","guid":{"rendered":"http:\/\/www.uvm.edu\/~waw\/blog\/?p=587"},"modified":"2008-06-04T22:16:54","modified_gmt":"2008-06-05T02:16:54","slug":"macmini-landscape-server-part-ii","status":"publish","type":"post","link":"https:\/\/blog.uvm.edu\/waw\/2008\/06\/04\/macmini-landscape-server-part-ii\/","title":{"rendered":"MacMini Landscape Server, Part II"},"content":{"rendered":"<p>&nbsp;So apparently php5 out of the Leopard box does not have GD or freetype support turned on. Tried a quickie rebuild of the gd.so dynamic loadlib for preinstalled PHP, but got all sorts of undefined errors when invoked.<\/p>\n<p>&nbsp;<\/p>\n<p>So Mike says, get fink and install fresh packages. Well, fink for 10.5 didn&#8217;t exist a few days ago. PHP5 is in the &quot;unstable&quot; brach of distributions, building libraries from fink didn&#8217;t always look back to see what other libraries were already installed (e.g., <b><code>fink install pnglib2<\/code><\/b> followed by <code><b>fink install gd2<\/b><\/code> , gd2 continued to look for pnglib in \/usr\/X11 ).<\/p>\n<p>&nbsp;<\/p>\n<p>So I went back to good old install from source into \/usr\/local. configured, maked, and installed libjpge-6, libpng, libfreetype, libgd. Then looked at the phpinfo for sample config for php. Saw something like this<\/p>\n<p>&nbsp;<\/p>\n<p><span class=\"Apple-style-span\" style=\"border-collapse: collapse;font-family: -webkit-sans-serif\">\/SourceCache\/apache_mod_php\/apache_mod_php-44\/php\/configure&#8217; &#8216;&#8211;prefix=\/usr&#8217; &#8216;&#8211;mandir=\/usr\/share\/man&#8217; &#8216;&#8211;infodir=\/usr\/share\/info&#8217; &#8216;&#8211;disable-dependency-tracking&#8217; &#8216;&#8211;with-apxs2=\/usr\/sbin\/apxs&#8217; &#8216;&#8211;with-ldap=\/usr&#8217; &#8216;&#8211;with-kerberos=\/usr&#8217; &#8216;&#8211;enable-cli&#8217; &#8216;&#8211;with-zlib-dir=\/usr&#8217; &#8216;&#8211;enable-trans-sid&#8217; &#8216;&#8211;with-xml&#8217; &#8216;&#8211;enable-exif&#8217; &#8216;&#8211;enable-ftp&#8217; &#8216;&#8211;enable-mbstring&#8217; &#8216;&#8211;enable-mbregex&#8217; &#8216;&#8211;enable-dbx&#8217; &#8216;&#8211;enable-sockets&#8217; &#8216;&#8211;with-iodbc=\/usr&#8217; &#8216;&#8211;with-curl=\/usr&#8217; &#8216;&#8211;with-config-file-path=\/etc&#8217; &#8216;&#8211;sysconfdir=\/private\/etc&#8217; &#8216;&#8211;with-mysql-sock=\/var\/mysql&#8217; &#8216;&#8211;with-mysqli=\/usr\/bin\/mysql_config&#8217; &#8216;&#8211;with-mysql=\/usr&#8217; &#8216;&#8211;with-openssl&#8217; &#8216;&#8211;with-xmlrpc&#8217; &#8216;&#8211;with-xsl=\/usr&#8217; &#8216;&#8211;without-pear&#8217;<\/span><\/p>\n<p>Wanted to be sure we had all the right compiler flags for universal builds. See&nbsp;<a href=\"http:\/\/developer.apple.com\/technotes\/tn2005\/tn2137.html\">http:\/\/developer.apple.com\/technotes\/tn2005\/tn2137.html<\/a>&nbsp;so we add<\/p>\n<p>MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS=&quot;-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os &nbsp;-pipe -no-cpp-precomp&quot; CCFLAGS=&quot;-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os &nbsp;-pipe&quot; CXXFLAGS=&quot;-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os &nbsp;-pipe&quot; LDFLAGS=&quot;-arch ppc -arch ppc64 -arch i386 -arch x86_64 -bind_at_load&quot;&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>and I want to enable built-in true type font support, so I add&nbsp;<b>&#8211;enable-gd-native-ttf<\/b><\/p>\n<p>yielding<\/p>\n<p>MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS=&quot;-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os &nbsp;-pipe -no-cpp-precomp&quot; CCFLAGS=&quot;-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os &nbsp;-pipe&quot; CXXFLAGS=&quot;-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os &nbsp;-pipe&quot; LDFLAGS=&quot;-arch ppc -arch ppc64 -arch i386 -arch x86_64 -bind_at_load&quot; .\/configure &#8211;prefix=\/usr &#8211;mandir=\/usr\/share\/man &#8211;infodir=\/usr\/share\/info &#8211;disable-dependency-tracking &#8211;with-apxs2=\/usr\/sbin\/apxs &#8211;with-ldap=\/usr &#8211;with-kerberos=\/usr &#8211;enable-cli &#8211;with-zlib-dir=\/usr &#8211;enable-trans-sid &#8211;with-xml &#8211;enable-exif &#8211;enable-ftp &#8211;enable-mbstring &#8211;enable-mbregex &#8211;enable-dbx &#8211;enable-sockets &#8211;enable-gd-native-ttf &#8211;with-iodbc=\/usr &#8211;with-curl=\/usr &#8211;with-config-file-path=\/etc &#8211;sysconfdir=\/private\/etc &#8211;with-mysql-sock=\/var\/mysql &#8211;with-mysqli=\/usr\/local\/mysql\/bin\/mysql_config &#8211;with-mysql=\/usr\/local\/mysql &#8211;with-openssl &#8211;with-xmlrpc &#8211;with-xsl=\/usr &#8211;without-pear<\/p>\n<p>But when it became time to compile, it failed, because the libmysql installed from the Package didn&#8217;t include the right&nbsp;<span class=\"Apple-style-span\" style=\"font-family: Georgia;font-size: 11px\">architectures. (just i386).<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>Tried again, reducing choices down to just i386. Resultant php5.so now fails when apache loads it, again a bad architectures problem<\/p>\n<p>So, now we download mysql source and recompile (with all the flags), and the try php build again.<\/p>\n<p>&nbsp;<\/p>\n<p>This time it almost worked, but no php was looking for libmysql in \/usr\/local\/mysql\/lib\/mysql , thanks to an errant &#8211;prefix= somwehere. Rather than fix it right, I just made an alias. PHP and APACHE started!<\/p>\n<p>But the graphs and such still fail.<\/p>\n<p>Turns out, I missed these two important points<\/p>\n<ol>\n<li>Using modified php.ini file that forced load og a gd.so built (incorrectly) days ago, and so newly compiled GD support was ignored<\/li>\n<li>Didn&#8217;t actually have built-in GD support turned on anyway. Need to specify &#8211;with-gd , And with-jpeg-dir=\/usr\/locak and with-freetype-dir=\/usr local<\/li>\n<\/ol>\n<p>&nbsp;So, final config for php is<\/p>\n<p style=\"margin-left: 40px\"><tt>MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS=&quot;-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os &nbsp;-pipe -no-cpp-precomp&quot; CCFLAGS=&quot;-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os &nbsp;-pipe&quot; CXXFLAGS=&quot;-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os &nbsp;-pipe&quot; LDFLAGS=&quot;-arch ppc -arch ppc64 -arch i386 -arch x86_64 -bind_at_load&quot; .\/configure --prefix=\/usr --mandir=\/usr\/share\/man --infodir=\/usr\/share\/info --disable-dependency-tracking --with-apxs2=\/usr\/sbin\/apxs --with-ldap=\/usr --with-kerberos=\/usr --enable-cli --with-zlib-dir=\/usr --enable-trans-sid --with-xml --enable-exif --enable-ftp --enable-mbstring --enable-mbregex --enable-dbx --enable-sockets --enable-gd-native-ttf --with-iodbc=\/usr --with-curl=\/usr --with-config-file-path=\/etc --sysconfdir=\/private\/etc --with-mysql-sock=\/var\/mysql --with-mysqli=\/usr\/local\/mysql\/bin\/mysql_config --with-mysql=\/usr\/local\/mysql --with-openssl --with-xmlrpc --with-xsl=\/usr --without-pear --with-gd --with-jpeg-dir=\/usr\/local --with-freetype-dir=\/usr\/local<\/tt><\/p>\n<p>&nbsp;And by golly, it all works!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When last we left this project, most things were working except freetype\/truetype text used in dynamic graphs and maps <a href=\"https:\/\/blog.uvm.edu\/waw\/2008\/06\/04\/macmini-landscape-server-part-ii\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38506,6517,8025,8026],"tags":[],"class_list":["post-587","post","type-post","status-publish","format-standard","hentry","category-landscape-change","category-projects","category-scriptingprogramming","category-systems-and-servers"],"_links":{"self":[{"href":"https:\/\/blog.uvm.edu\/waw\/wp-json\/wp\/v2\/posts\/587","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.uvm.edu\/waw\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.uvm.edu\/waw\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.uvm.edu\/waw\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.uvm.edu\/waw\/wp-json\/wp\/v2\/comments?post=587"}],"version-history":[{"count":0,"href":"https:\/\/blog.uvm.edu\/waw\/wp-json\/wp\/v2\/posts\/587\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.uvm.edu\/waw\/wp-json\/wp\/v2\/media?parent=587"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.uvm.edu\/waw\/wp-json\/wp\/v2\/categories?post=587"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.uvm.edu\/waw\/wp-json\/wp\/v2\/tags?post=587"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}