Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Help-Config/build of PHP php-5.2.4- Mac OS X 10.4.10.......with GD support

I am trying to install PHP with GD support on Mac OS X and have had varying success but have not been able to get GD working.

[1] I have tried installing PHP from http://www.entropy.ch/software/macosx/php/ but that did not work.....

[2] so then I tried to build and install PHP from the source distribution per Apple support instructions at: http://developer.apple.com/internet/opensource/php.html...........I was initiall able to run PHP and get the phpinfo() displayed in a web page but I notcied GD was not listed as an active module even though I followed the library installation instructions using fink on the apple web page instructions http://developer.apple.com/internet/opensource/php.html

[3] Now I am at a point where it does not seem like ./configure --with-someOptions is working properly because it does not seem to be able to find libjpeg or any of the libraries even though fink indicates they are installed

*has anyone found a solution for instiallin and running PHP with Apache on Mac OS X 10.4.10???????*

thanks,

Posted on Sep 9, 2007 1:27 AM

Reply
4 replies

Sep 9, 2007 8:18 AM in response to Robert Stephens

Hi Robert--

Robert Stephens wrote:
[1] I have tried installing PHP from http://www.entropy.ch/software/macosx/php/ but that did not work.....


How did it not work? I've installed it successfully and am using it on my Intel iMac. There are a couple of tricky things to installing it. First, Marc has a couple of versions, so make sure you're getting the correct one. The default Apache installed with OS X is currently 1.3, so you'd need that version.

The second tricky bit is that if you've already enabled the default PHP4, you need to comment out the two lines that load PHP4 in your httpd.conf file. Once you do that, GD should work, I think. Post back with more information on the problems you're having with the Entropy PHP installation...

charlie

Sep 9, 2007 12:40 PM in response to Robert Stephens

Hi Charlie,

well, I am running Apache 1.3 and I did download the binary installer for that version. The first time I ran it my index.php page did not load so I deleated the php5 directory and the entropy symbolic links per the instructions on Marc's page at http://www.entropy.ch/software/macosx/php/

Next I tried to install from sources using the instructions at http://developer.apple.com/internet/opensource/php.html I used fink to install the libraries needed for GD...........this installation was the mostly successfull the first time but GD was not listed in phpinfo()..........so then I tried to install this a second time and now ./configure command seems to be complaining about not being able to find the libjpeg, libpng, etc. libraries even though they are there.

*........ideally I would like to understand how to either 1) clean off this installation and try Marc's binary installaer one or time or 2) get a verified procedure for installing PHP 5.2.4 from sources with libraries needed for GD*

thanks

*Here are some lines from the currently installation of PHP from sources using phpinfo()*

Build Date Sep 4 2007
Configure Command './configure' '--with-apxs'
SERVER_SOFTWARE Apache/1.3.33 (Darwin) PHP/5.2.4

*Here is the output from the ./configure command running from /apps/php-5.2.4*

lab4:/apps/php-5.2.4 developer1$ ./configure --with-zlib-dir=/usr/local \
--with-libjpeg=/sw \
--with-libtiff=/sw \
--with-libpng=/sw \
--with-gd \
--with-xml \
--with-apxs

loading cache ./config.cache
checking for Cygwin environment... no
checking for mingw32 environment... no
checking for egrep... grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking host system type... powerpc-apple-darwin8.10.0
checking target system type... powerpc-apple-darwin8.10.0
checking for gcc... gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking how to run the C preprocessor... gcc -E
checking for icc... no
checking whether gcc and cc understand -c and -o together... yes
checking how to run the C preprocessor... gcc -E
checking for AIX... no
checking whether ln -s works... yes
checking for system library directory... lib
checking whether to enable runpaths... yes
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... no
checking for re2c... no
configure: warning: You will need re2c 0.12.0 or later if you want to regenerate PHP parsers.
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking for bison... bison -y
checking for bison version... 1.28 (ok)
checking for flex... flex
checking for yywrap in -lfl... yes
checking lex output file root... lex.yy
checking whether yytext is a pointer... yes
checking for working const... yes
checking for flex version... 2.5.4 (ok)
checking whether gcc supports -no-cpp-precomp... yes
checking whether to force non-PIC code in shared modules... no
checking whether /dev/urandom exists... yes
checking for pthreads_cflags...
checking for pthreads_lib...

Configuring SAPI modules
checking for AOLserver support... no
checking for Apache 1.x module support via DSO through APXS... yes
checking for Apache 1.x module support... no
checking whether to enable Apache charset compatibility option... no
checking for member fd in BUFF *... yes
checking for Apache 2.0 filter-module support via DSO through APXS... no
checking for Apache 2.0 handler-module support via DSO through APXS... no
checking for Apache 1.x (hooks) module support via DSO through APXS... no
checking for Apache 1.x (hooks) module support... no
checking whether to enable Apache charset compatibility option... no
checking for Caudium support... no
checking for CLI build... yes
checking for Continuity support... no
checking for embedded SAPI library support... no
checking for Zeus ISAPI support... no
checking for Milter support... no
checking for NSAPI support... no
checking for PHTTPD support... no
checking for Pi3Web support... no
checking whether Roxen module is build using ZTS... no
checking for Roxen/Pike support...
checking for thttpd... no
checking for TUX... no
checking for webjames... no
checking for chosen SAPI module... apache

Running system checks
checking for sendmail... /usr/sbin/sendmail
checking whether system uses EBCDIC... no
checking whether byte ordering is bigendian... yes
checking whether writing to stdout works... This is the test message -- yes
checking for socket... yes
checking for socketpair... yes
checking for htonl... yes
checking for gethostname... yes
checking for gethostbyaddr... yes
checking for yp get_defaultdomain... yes
checking for dlopen... yes
checking for sin in -lm... yes
checking for res_search... yes
checking for inet_aton... yes
checking for dn_skipname... no
checking for _dnskipname... yes
checking for ANSI C header files... yes
checking for dirent.h that defines DIR... yes
checking for opendir in -ldir... no
checking for inttypes.h... yes
checking for stdint.h... yes
checking for dirent.h... yes
checking for ApplicationServices/ApplicationServices.h... yes
checking for sys/param.h... yes
checking for sys/types.h... yes
checking for sys/time.h... yes
checking for netinet/in.h... yes
checking for alloca.h... yes
checking for arpa/inet.h... yes
checking for arpa/nameser.h... yes
checking for assert.h... yes
checking for crypt.h... no
checking for fcntl.h... yes
checking for grp.h... yes
checking for ieeefp.h... no
checking for langinfo.h... yes
checking for limits.h... yes
checking for locale.h... yes
checking for monetary.h... yes
checking for mach-o/dyld.h... yes
checking for netdb.h... yes
checking for pwd.h... yes
checking for resolv.h... yes
checking for signal.h... yes
checking for stdarg.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for syslog.h... yes
checking for sysexits.h... yes
checking for sys/ioctl.h... yes
checking for sys/file.h... yes
checking for sys/mman.h... yes
checking for sys/mount.h... yes
checking for sys/poll.h... yes
checking for sys/resource.h... yes
checking for sys/select.h... yes
checking for sys/socket.h... yes
checking for sys/stat.h... yes
checking for sys/statfs.h... no
checking for sys/statvfs.h... yes
checking for sys/vfs.h... no
checking for sys/sysexits.h... no
checking for sys/varargs.h... no
checking for sys/wait.h... yes
checking for sys/loadavg.h... no
checking for termios.h... yes
checking for unistd.h... yes
checking for unix.h... no
checking for utime.h... yes
checking for sys/utsname.h... yes
checking for sys/ipc.h... yes
checking for dlfcn.h... yes
checking for assert.h... (cached) yes
checking for fopencookie... no
checking for broken getcwd... no
checking for broken libc stdio... no
checking whether struct tm is in sys/time.h or time.h... time.h
checking for tm_zone in struct tm... yes
checking for missing declarations of reentrant functions... done
checking for fclose declaration... ok
checking for tm_gmtoff in struct tm... yes
checking for struct flock... yes
checking for socklen_t... yes
checking size of size_t... 4
checking size of long long... 8
checking size of long long int... 8
checking size of long... 4
checking size of int... 4
checking size of intmax_t... 8
checking size of ssize_t... 4
checking size of ptrdiff_t... 4
checking for st_blksize in struct stat... yes
checking for st_blocks in struct stat... yes
checking for st_rdev in struct stat... yes
checking for size_t... yes
checking for uid_t in sys/types.h... yes
checking for struct sockaddr_storage... yes
checking for field sa_len in struct sockaddr... yes
checking for IPv6 support... yes
checking for vprintf... yes
checking for alphasort... yes
checking for asctime_r... yes
checking for chroot... yes
checking for ctime_r... yes
checking for cuserid... no
checking for crypt... yes
checking for flock... yes
checking for ftok... yes
checking for funopen... yes
checking for gai_strerror... yes
checking for gcvt... yes
checking for getloadavg... yes
checking for getlogin... yes
checking for getprotobyname... yes
checking for getprotobynumber... yes
checking for getservbyname... yes
checking for getservbyport... yes
checking for getrusage... yes
checking for gettimeofday... yes
checking for gmtime_r... yes
checking for getpwnam_r... yes
checking for getgrnam_r... yes
checking for getpwuid_r... yes
checking for grantpt... yes
checking for inet_ntoa... yes
checking for inet_ntop... yes
checking for inet_pton... yes
checking for isascii... yes
checking for link... yes
checking for localtime_r... yes
checking for lockf... yes
checking for lchown... yes
checking for lrand48... yes
checking for memcpy... yes
checking for memmove... yes
checking for mkstemp... yes
checking for mmap... yes
checking for nl_langinfo... yes
checking for perror... yes
checking for poll... yes
checking for ptsname... yes
checking for putenv... yes
checking for realpath... yes
checking for random... yes
checking for rand_r... yes
checking for regcomp... yes
checking for res_search... (cached) yes
checking for scandir... yes
checking for setitimer... yes
checking for setlocale... yes
checking for localeconv... yes
checking for setenv... yes
checking for setpgid... yes
checking for setsockopt... yes
checking for setvbuf... yes
checking for shutdown... yes
checking for sin... yes
checking for snprintf... yes
checking for srand48... yes
checking for srandom... yes
checking for statfs... yes
checking for statvfs... yes
checking for std_syslog... no
checking for strcasecmp... yes
checking for strcoll... yes
checking for strdup... yes
checking for strerror... yes
checking for strftime... yes
checking for strptime... yes
checking for strstr... yes
checking for strtok_r... yes
checking for symlink... yes
checking for tempnam... yes
checking for tzset... yes
checking for unlockpt... yes
checking for unsetenv... yes
checking for usleep... yes
checking for nanosleep... yes
checking for utime... yes
checking for vsnprintf... yes
checking for getaddrinfo... yes
checking for strlcat... yes
checking for strlcpy... yes
checking for getopt... yes
checking whether utime accepts a null argument... yes
checking for working alloca.h... (cached) yes
checking for alloca... yes
checking for declared timezone... yes
checking for type of reentrant time-related functions... POSIX
checking for readdir_r... yes
checking for type of readdir_r... POSIX
checking for in addrt... yes
checking for crypt_r... no

General settings
checking whether to include gcov symbols... no
checking whether to include debugging symbols... no
checking layout of installed files... PHP
checking path to configuration file... DEFAULT
checking where to scan for configuration files...
checking whether to enable safe mode by default... no
checking for safe mode exec dir... /usr/local/php/bin
checking whether to enable PHP's own SIGCHLD handler... no
checking whether to enable magic quotes by default... no
checking whether to explicitly link against libgcc... no
checking whether to enable short tags by default... yes
checking whether to enable dmalloc... no
checking whether to enable IPv6 support... yes
checking how big to make fd sets... using system default

Configuring extensions
checking whether to enable LIBXML support... yes
checking libxml2 install dir... no
checking for xml2-config path... /usr/bin/xml2-config
checking whether libxml build works... yes
checking for OpenSSL support... no
checking for Kerberos support... no
checking for PCRE support... yes
checking for ZLIB support... no
checking if the location of ZLIB install directory is defined... /usr/local
checking for gzgets in -lz... yes
checking whether to enable bc style precision math functions... no
checking for BZip2 support... no
checking whether to enable calendar conversion support... no
checking whether to enable ctype functions... yes
checking for cURL support... no
checking if we should use cURL for url streams... no
checking size of long... (cached) 4
checking size of int... (cached) 4
checking for int32_t... yes
checking for uint32_t... yes
checking for sys/types.h... (cached) yes
checking for inttypes.h... (cached) yes
checking for stdint.h... (cached) yes
checking for string.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for strtoll... yes
checking for atoll... yes
checking for strftime... (cached) yes
checking for QDBM support... no
checking for GDBM support... no
checking for NDBM support... no
checking for Berkeley DB4 support... no
checking for Berkeley DB3 support... no
checking for Berkeley DB2 support... no
checking for DB1 support... no
checking for DBM support... no
checking for CDB support... no
checking for INI File support... no
checking for FlatFile support... no
checking whether to enable DBA interface... no
checking whether to enable dbase support... no
checking whether to enable DOM support... yes
checking for xml2-config path... (cached) /usr/bin/xml2-config
checking whether libxml build works... (cached) yes
checking whether to enable EXIF (metadata from images) support... no
checking for FrontBase SQL92 (fbsql) support... no
checking for FDF support... no
checking whether to enable input filter support... yes
checking pcre install prefix... no
checking whether to enable FTP support... no
checking OpenSSL dir for FTP... no
checking for GD support... yes
checking for the location of libjpeg... no
checking for the location of libpng... no
checking for the location of libXpm... no
checking for FreeType 1.x support... no
checking for FreeType 2... no
checking for T1lib support... no
checking whether to enable truetype string function in GD... no
checking whether to enable JIS-mapped Japanese font support in GD... no
checking for fabsf... yes
checking for floorf... yes
If configure fails try --with-jpeg-dir=<DIR>
configure: error: libpng.(a|so) not found.
lab4:/apps/php-5.2.4 developer1$


thanks

Sep 9, 2007 9:16 PM in response to Robert Stephens

I'd suggest trying Marc's installer again. The directions you're using at the Apple site are for an older version of PHP, so they might not work with 5.x sources. If you've done any customizing of the Apache config file, you might need to start over by backing up the current one and copying in the default one:

sudo mv /etc/httpd/httpd.conf /etc/httpd/httpd.conf.07bak
sudo cp /etc/httpd/httpd.conf.default /etc/httpd/httpd.conf


That'll get you back to square one as far as Apache is concerned, which might help. Then install Marc's PHP package, and don't forget to stop and restart Apache.

I honestly don't remember having too much trouble setting up Marc's PHP5, so it's a bit hard to figure out where you're getting hung up. When you say it "didn't show" the page, what exactly did it do? Show the raw PHP code? Show nothing? Did you look in the Apache log? It's at /var/log/httpd/ and will often tell you exactly what's going on. I have my Console app open pretty much all the time when I'm working on web site scripts, be they Perl or PHP. I find it invaluable, it'll even give me the line number where the error occurred.

As for " configure" behaving strangely, I don't know enough about it to be of much help. But it could be because you're following instructions for PHP4, not PHP5...

charlie

Sep 9, 2007 10:26 PM in response to Robert Stephens

Working Now!!!!

Interestingly enough, when I had installed PHP 5.2.4 from the source distribution at: http://www.php.net/downloads.php my index.php file worked (displayed phpinfo()) with the following index.php file contents (only thing missing in the table summary in this case was GD):

<html><body>

Test Page


<? phpinfo()?>
</body></html>

When I installed PHP 5.2.4 with GD using the binary installer located at: http://www.entropy.ch/software/macosx/php/.............the page **never showed the phpinfo() table** which made it appear as though php was not running...........after changing the index.php file to the following the table appeared showing it was properly configured (./configure info at top of table) and that GD was active:

<html><body>

Test Page


<?php phpinfo()?>
</body></html>

still looking into why GD was not installed properly when doing a build from scratch but the binary installation now works.....

thanks for your help

Help-Config/build of PHP php-5.2.4- Mac OS X 10.4.10.......with GD support

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.