GTK2 loading in PHP is not performed

I have already done the following:

Installed PHP 5.3.3 Installed GTK 2.0.1 Installed the latest version of php-gtk from svn All dependencies are resolved and installed. 

I edited php.ini to load the GTk library into the PHP lib extension=php_gtk2.so as extension=php_gtk2.so and saved it.

If I check with php -m , I find one error, for example Unable to Load Dynamic Library ../../php_gtk2.so I assume that this may be because php_gtk2.so is a static library.

Then how can I download it? Any idea where I made a mistake?

I work on CentOS 6.0 Server , PHP 5.3.3 , GTK 2.0.1

 edit: 

The exact problem is given below:

  [ root@srv-vg phpapps]# php -m PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/php_gtk2.so' - /usr/lib/php/modules/php_gtk2.so: undefined symbol: php_cairo_get_context_ce in Unknown on line 0 [PHP Modules] apc bz2 calendar Core ctype curl date dom ereg exif fileinfo filter ftp gd gettext gmp hash iconv json ldap libxml memcache mysql mysqli odbc openssl pcntl pcre PDO pdo_mysql PDO_ODBC pdo_pgsql pdo_sqlite pgsql Phar readline Reflection session shmop SimpleXML soap sockets SPL sqlite3 standard tokenizer wddx xml xmlreader xmlrpc xmlwriter xsl zip zlib [Zend Modules] 

As hakre said, I tried downloading the cairo extension by adding the cairo.ini file. But now it also shows some error similar to this

 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/cairo.so' - /usr/lib/php/modules/cairo.so: undefined symbol: cairo_ce_cairosubsurface in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/php_gtk2.so' - /usr/lib/php/modules/php_gtk2.so: undefined symbol: php_cairo_get_context_ce in Unknown on line 0 [PHP Modules] 

edit2:

When I installed cairo , an error occurred in cairo_surface.c , and I cleaned it up like someone on the forums that said to do. I could install cairo successfully. But now, how about this !!

+4
source share
2 answers

So you installed from SVN. But something with compiled binary has a problem to find the php_cairo_get_context_ce character.

Your list of modules shows that you do not have the cairo extension installed.

Install it and download it before php-gtk.

+1
source

I ran into the same problem in ubuntu. What I did to fix it was

  • Changed the resolution of php_gtk2.so , cairo.so files in the / usr / lib / php5 / 20121212 directory to 644 . He used to be 777 . The last number on the way may be different for other systems that I don't know.
  • Updated file sudo gedit /etc/php5/cli/php.ini Added an entry for these two modules in a section called Dynamic Extensions

    extension= /usr/lib/php5/20121212/cairo.so extension= /usr/lib/php5/20121212/php_gtk2.so

Please note that the order, cairo.so , must be the first. Previously, php_gtk2.so was the first that caused the error, I suppose.

  1. Finally, I managed to start the demonstration from the php-gtk-src directory from the terminal using the command $ php demos/phpgtk2-demo.php

Hope this helps :)

0
source

Source: https://habr.com/ru/post/1388573/


All Articles