| View previous topic :: View next topic |
| Author |
Message |
beidlerj
Joined: 10 Feb 2006 Posts: 55 Location: Oregon, USA
|
Posted: Wed Sep 06, 2006 8:56 pm Post subject: OS X Install? |
|
|
Hello -
Anyone successfully installed PHP-Gtk2 on Mac OS X? I have been unable to do so. I was trying to set up PHP5 separate from the Apache/PHP4 setup that's currently running, so I won't have to worry about messing that up. I am by no means a Unix guru, so I have been having a heck of a time trying to install all the dependencies and all. Gotta have Gtk+ installed before installing PHP or PHP-Gtk, but those require their own libraries, which require their own tools and dependencies, etc.
There has got to be an easier way! Please help a poor idjit like me!
Thanks,
Jeff |
|
| Back to top |
|
 |
cweiske
Joined: 08 Dec 2005 Posts: 454 Location: Leipzig/Germany
|
|
| Back to top |
|
 |
beidlerj
Joined: 10 Feb 2006 Posts: 55 Location: Oregon, USA
|
Posted: Thu Sep 07, 2006 10:28 pm Post subject: |
|
|
Thanks, Christian! That MacPorts tool is nice!
For other users info: get the "gtk28" port, not "gtk2", which tries to install Gtk+2.10.x, but has bugs. It complains about cups.
Okay, next question: should I try a branch other than PHP_5_2, if I get all of the following when running 'make'?
| Code: |
dev:~/php-src admin$ make
/bin/sh /Users/admin/php-src/libtool --silent --preserve-dup-deps --mode=compile gcc -Iext/libxml/ -I/Users/admin/php-src/ext/libxml/ -DPHP_ATOM_INC -I/Users/admin/php-src/include -I/Users/admin/php-src/main -I/Users/admin/php-src -I/usr/include/libxml2 -I/Users/admin/php-src/ext/date/lib -I/Users/admin/php-src/TSRM -I/Users/admin/php-src/Zend -no-cpp-precomp -I/usr/include -g -O2 -c /Users/admin/php-src/ext/libxml/libxml.c -o ext/libxml/libxml.lo
/Users/admin/php-src/ext/libxml/libxml.c:43:28: libxml/xmlsave.h: No such file or directory
/Users/admin/php-src/ext/libxml/libxml.c:428: error: parse error before "error"
/Users/admin/php-src/ext/libxml/libxml.c: In function `_php_libxml_free_error':
/Users/admin/php-src/ext/libxml/libxml.c:430: error: `error' undeclared (first use in this function)
/Users/admin/php-src/ext/libxml/libxml.c:430: error: (Each undeclared identifier is reported only once
/Users/admin/php-src/ext/libxml/libxml.c:430: error: for each function it appears in.)
/Users/admin/php-src/ext/libxml/libxml.c: At top level:
/Users/admin/php-src/ext/libxml/libxml.c:434: error: parse error before "error"
/Users/admin/php-src/ext/libxml/libxml.c: In function `_php_list_set_error_structure':
/Users/admin/php-src/ext/libxml/libxml.c:436: error: `xmlError' undeclared (first use in this function)
/Users/admin/php-src/ext/libxml/libxml.c:436: error: parse error before "error_copy"
/Users/admin/php-src/ext/libxml/libxml.c:441: error: `error_copy' undeclared (first use in this function)
/Users/admin/php-src/ext/libxml/libxml.c:443: error: `error' undeclared (first use in this function)
/Users/admin/php-src/ext/libxml/libxml.c:448: error: `XML_ERR_ERROR' undeclared (first use in this function)
/Users/admin/php-src/ext/libxml/libxml.c:454: error: `msg' undeclared (first use in this function)
/Users/admin/php-src/ext/libxml/libxml.c: At top level:
/Users/admin/php-src/ext/libxml/libxml.c:546: error: parse error before "xmlErrorPtr"
/Users/admin/php-src/ext/libxml/libxml.c: In function `php_libxml_structured_error_handler':
/Users/admin/php-src/ext/libxml/libxml.c:548: error: `error' undeclared (first use in this function)
/Users/admin/php-src/ext/libxml/libxml.c: In function `zm_startup_libxml':
/Users/admin/php-src/ext/libxml/libxml.c:603: error: `XML_PARSE_NOENT' undeclared (first use in this function)
/Users/admin/php-src/ext/libxml/libxml.c:604: error: `XML_PARSE_DTDLOAD' undeclared (first use in this function)
/Users/admin/php-src/ext/libxml/libxml.c:605: error: `XML_PARSE_DTDATTR' undeclared (first use in this function)
/Users/admin/php-src/ext/libxml/libxml.c:606: error: `XML_PARSE_DTDVALID' undeclared (first use in this function)
/Users/admin/php-src/ext/libxml/libxml.c:607: error: `XML_PARSE_NOERROR' undeclared (first use in this function)
/Users/admin/php-src/ext/libxml/libxml.c:608: error: `XML_PARSE_NOWARNING' undeclared (first use in this function)
/Users/admin/php-src/ext/libxml/libxml.c:609: error: `XML_PARSE_NOBLANKS' undeclared (first use in this function)
/Users/admin/php-src/ext/libxml/libxml.c:610: error: `XML_PARSE_XINCLUDE' undeclared (first use in this function)
/Users/admin/php-src/ext/libxml/libxml.c:611: error: `XML_PARSE_NSCLEAN' undeclared (first use in this function)
/Users/admin/php-src/ext/libxml/libxml.c:612: error: `XML_PARSE_NOCDATA' undeclared (first use in this function)
/Users/admin/php-src/ext/libxml/libxml.c:613: error: `XML_PARSE_NONET' undeclared (first use in this function)
/Users/admin/php-src/ext/libxml/libxml.c:621: error: `XML_ERR_NONE' undeclared (first use in this function)
/Users/admin/php-src/ext/libxml/libxml.c:622: error: `XML_ERR_WARNING' undeclared (first use in this function)
/Users/admin/php-src/ext/libxml/libxml.c:623: error: `XML_ERR_ERROR' undeclared (first use in this function)
/Users/admin/php-src/ext/libxml/libxml.c:624: error: `XML_ERR_FATAL' undeclared (first use in this function)
/Users/admin/php-src/ext/libxml/libxml.c: In function `zif_libxml_use_internal_errors':
/Users/admin/php-src/ext/libxml/libxml.c:707: error: `xmlStructuredErrorFunc' undeclared (first use in this function)
/Users/admin/php-src/ext/libxml/libxml.c:707: error: parse error before "current_handler"
/Users/admin/php-src/ext/libxml/libxml.c:714: error: `current_handler' undeclared (first use in this function)
/Users/admin/php-src/ext/libxml/libxml.c:714: error: `xmlStructuredError' undeclared (first use in this function)
/Users/admin/php-src/ext/libxml/libxml.c:736: error: `xmlError' undeclared (first use in this function)
/Users/admin/php-src/ext/libxml/libxml.c: In function `zif_libxml_get_last_error':
/Users/admin/php-src/ext/libxml/libxml.c:747: error: `xmlErrorPtr' undeclared (first use in this function)
/Users/admin/php-src/ext/libxml/libxml.c:747: error: parse error before "error"
/Users/admin/php-src/ext/libxml/libxml.c:749: error: `error' undeclared (first use in this function)
/Users/admin/php-src/ext/libxml/libxml.c: In function `zif_libxml_get_errors':
/Users/admin/php-src/ext/libxml/libxml.c:778: error: `xmlErrorPtr' undeclared (first use in this function)
/Users/admin/php-src/ext/libxml/libxml.c:778: error: parse error before "error"
/Users/admin/php-src/ext/libxml/libxml.c:786: error: `error' undeclared (first use in this function)
make: *** [ext/libxml/libxml.lo] Error 1
dev:~/php-src admin$
|
|
|
| Back to top |
|
 |
cweiske
Joined: 08 Dec 2005 Posts: 454 Location: Leipzig/Germany
|
Posted: Thu Sep 07, 2006 10:30 pm Post subject: |
|
|
| Seems you are missing the libxml (or libxml2) header files |
|
| Back to top |
|
 |
beidlerj
Joined: 10 Feb 2006 Posts: 55 Location: Oregon, USA
|
Posted: Thu Sep 07, 2006 10:38 pm Post subject: |
|
|
| Shouldn't they have come with the CVS download of PHP_5_2? How do I get them, then? |
|
| Back to top |
|
 |
cweiske
Joined: 08 Dec 2005 Posts: 454 Location: Leipzig/Germany
|
Posted: Thu Sep 07, 2006 10:40 pm Post subject: |
|
|
| I guess that's what Fink/DarwinPorts is for. And no, libxml is an external library that is indepdentent of PHP, php just uses it. |
|
| Back to top |
|
 |
beidlerj
Joined: 10 Feb 2006 Posts: 55 Location: Oregon, USA
|
Posted: Thu Sep 07, 2006 10:50 pm Post subject: |
|
|
Ah, okay. I thought it was something built into the inner workings of PHP. I don't know how it's made, just how to use it!
So, does it matter which of these packages I get, then, or should I get both?
| Code: |
libxml textproc/libxml 1.8.17 XML parsing library
libxml2 textproc/libxml2 2.6.23 gnome xml library
|
|
|
| Back to top |
|
 |
cweiske
Joined: 08 Dec 2005 Posts: 454 Location: Leipzig/Germany
|
Posted: Thu Sep 07, 2006 11:01 pm Post subject: |
|
|
| IMO you can configure PHP to use libxml OR libxml2 - do a "./configure --help" to see the switch. I guess that libxml2 is more advanced, so try this and configure php so that it uses it. |
|
| Back to top |
|
 |
beidlerj
Joined: 10 Feb 2006 Posts: 55 Location: Oregon, USA
|
Posted: Fri Sep 08, 2006 12:18 am Post subject: |
|
|
Okay, got that part to work... used MacPorts to get the libxml packages (ended up with both, don't think it matters) and finally got 'make' to run after doing './config --disable-cgi --with-libxml-dir-/opt/local' (Note: without subdirectory name... tried unsuccessfully twice, using "/opt/local/include" and "/opt/local/lib".
So, now I've a new problem... must I also MacPort 'wget'?
| Code: |
dev:~/php-src admin$ sudo make install
Password:
Installing PHP CLI binary: /usr/local/bin/
Installing PHP CLI man page: /usr/local/man/man1/
Installing build environment: /usr/local/lib/php/build/
Installing header files: /usr/local/include/php/
Installing helper programs: /usr/local/bin/
program: phpize
program: php-config
Installing man pages: /usr/local/man/man1/
page: phpize.1
page: php-config.1
Installing PEAR environment: /usr/local/lib/php/
/bin/sh: line 1: wget: command not found
make: *** [install-pear] Error 127
dev:~/php-src admin$ port search wget
gwget gnome/gwget 0.96 Gwget is a Download Manager for Gnome 2. It uses wget as a backend.
wget net/wget 1.10.2 internet file retriever
dev:~/php-src admin$
|
|
|
| Back to top |
|
 |
cweiske
Joined: 08 Dec 2005 Posts: 454 Location: Leipzig/Germany
|
Posted: Fri Sep 08, 2006 12:20 am Post subject: |
|
|
| Seems so :) |
|
| Back to top |
|
 |
beidlerj
Joined: 10 Feb 2006 Posts: 55 Location: Oregon, USA
|
Posted: Fri Sep 08, 2006 1:16 am Post subject: |
|
|
Okay, I got wget (I guess it was PEAR that needed it... I wondered for a while why PHP would need an Internet file retrieval system) and the rest of the installation went off without a hitch.
I followed the rest of the directions from the link posted above, and now PHP 5.2 is running on my system! I copied the php.ini-recommended file over, made the symlink in /usr/bin, all that jazz. I edited the php.ini file, and when running "php -i", I see the following line:
| Code: |
extension_dir => /usr/local/lib/php/extensions/no-debug-non-zts-20060613 => /usr/local/lib/php/extensions/no-debug-non-zts-20060613
|
However, when I try to run a PHP-Gtk2 file, I get:
| Code: |
Please check your php.ini to make sure the PHP-Gtk2 module is available.
|
Is there something else remaining to do, in order to make my program run? |
|
| Back to top |
|
 |
cweiske
Joined: 08 Dec 2005 Posts: 454 Location: Leipzig/Germany
|
Posted: Fri Sep 08, 2006 8:32 am Post subject: |
|
|
Have a look at the linux instructions -> Testing your installation.
Edit: I extendet the macos x installation instructions. |
|
| Back to top |
|
 |
beidlerj
Joined: 10 Feb 2006 Posts: 55 Location: Oregon, USA
|
Posted: Fri Sep 08, 2006 6:16 pm Post subject: |
|
|
Okay, added "extension=php_gtk2.so" to my php.ini...
Now I get this:
| Code: |
dev:/opt/local admin$ phpgtk -m
PHP Fatal error: php-gtk: Could not open display in Unknown on line 0
|
What does that mean? |
|
| Back to top |
|
 |
cweiske
Joined: 08 Dec 2005 Posts: 454 Location: Leipzig/Germany
|
Posted: Fri Sep 08, 2006 6:57 pm Post subject: |
|
|
| It means that Gtk can't open the display resource, meaning your current desktop to draw windows on. I guess you need X running for it. |
|
| Back to top |
|
 |
beidlerj
Joined: 10 Feb 2006 Posts: 55 Location: Oregon, USA
|
Posted: Fri Sep 08, 2006 11:49 pm Post subject: |
|
|
Okay, turns out my installation of X11 was faulty. Re-installed it, and now php-gtk runs! Well, kind of... it complains about Glade, of course, since (in following the directions) it was compiled with the --disable-libglade option. What was the reason for using that option?
My next move was to try to recompile without using that option, but installing the XCode tools and X11 seems to have broken my gcc:
| Code: |
dev:~/php-gtk admin$ ./configure --with-php-config=/usr/local/bin/php-config
checking for egrep... grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for gcc... gcc
checking for C compiler default output... configure: error: C compiler cannot create executables
See `config.log' for more details.
|
The config.log file is greek to me, of course.
Sorry for the myriad of questions... a Linux guru I am *not*!!!
Thanks for your patience. |
|
| Back to top |
|
 |
|