php-extension

Detect if the FreeType PHP extension is installed on the server

↘锁芯ラ 提交于 2019-12-01 15:14:51
How do I test to see if the FreeType extension is installed on a server running PHP? I wanted to make a simple CAPTCHA system on my site, so I used imagettftext() and it worked fine. But what if the server didn't have the FreeType library installed? So is there a way to somehow detect FreeType library through code, and if it is not present, fall back to something like imagestring() ? If I can't use imagettftext() I may have to look at alternatives to draw big font text as the imagestring max size isn't good for something like a CAPTCHA. Norm Use function_exists : if (function_exists(

PHP Startup: Unable to load dynamic library `curl.so` Ubuntu

牧云@^-^@ 提交于 2019-12-01 15:07:35
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20131226/curl.so' - /usr/lib/php/20131226/curl.so: undefined symbol: zend_unset_property in Unknown on line 0 I am using Ubuntu 14.04 LTS and PHP v5.6 There are other versions in same machine php5 and php7 but php5.6 has been enabled. I tried to install cURL by sudo apt-get install php5.6-curl Now I am getting Unable to load dynamic library curl.so After running php -i | grep ini I get the following root@ubuntu:/etc/php/5.6/apache2# php -i | grep ini PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php

Possible to disable intl requirement for Symfony?

强颜欢笑 提交于 2019-12-01 09:24:25
I have a Symfony 2 project on a shared host. And apparently provider won't switch the Intl extension on for PHP. Is there a way to turn it on or am I forced to reevaluate the whole project? If your web server doesn't provide the intl extension, you can use the Locale component. It can be easily installed with composer or using the Git repository . Source : http://symfony.com/doc/master/components/locale.html UPDATE The Locale component is deprecated since version 2.3 and will be removed in Symfony 3.0. You should use the Intl component instead ( http://symfony.com/doc/master/components/intl

Installing dBase extension in XAMPP

我与影子孤独终老i 提交于 2019-12-01 07:34:58
I have a problem with installing dBase extension in XAMPP with PHP 5.5.11. I added php_dbase.dll to php/ext folder and added following line to the php.ini file: extension=php_dbase.dll But when I try this code in my script: dbase_open('file.dbf'); I got an error message: Call to undefined function dbase_open()' How to properly install dBase extension? Try with this link: http://pecl.php.net/package/dbase/5.1.0/windows In my case i have: XAMPP 1.8.3 [PHP: 5.5.15] And i use: php_dbase-5.1.0-5.5-ts-vc11-x86.zip Download the correct version for your PHP windows environmet. Regards, Avinash Babu

Code completion for PHP extensions in Zend Studio?

我怕爱的太早我们不能终老 提交于 2019-12-01 07:20:56
问题 After having installed the HTTP extension from PECL, I expected Zend Studio 6 to recognize the provided HTTP* classes and for code completion to be made available. This is not the case, however. How do I get Zend Studio to recognize classes provided by PHP extensions? Specifcally, I want to be able to use code competition on these classes. 回答1: I used the phpgenerator.php script from Michael Spector. It generates a php documentation folder with the loaded extensions on your pc. Afterwards the

Installing dBase extension in XAMPP

隐身守侯 提交于 2019-12-01 04:16:55
问题 I have a problem with installing dBase extension in XAMPP with PHP 5.5.11. I added php_dbase.dll to php/ext folder and added following line to the php.ini file: extension=php_dbase.dll But when I try this code in my script: dbase_open('file.dbf'); I got an error message: Call to undefined function dbase_open()' How to properly install dBase extension? 回答1: Try with this link: http://pecl.php.net/package/dbase/5.1.0/windows In my case i have: XAMPP 1.8.3 [PHP: 5.5.15] And i use: php_dbase-5.1

Compiling a php extension with Visual Studio 2008, MODULE ID don't match with php

跟風遠走 提交于 2019-11-30 23:46:31
After compiling my own php extension using VC9 (2008) and VC10 (2010) using the next steps: http://blog.slickedit.com/2007/09/creating-a-php-5-extension-with-visual-c-2005/ I get the next error when initializing php: PHP Warning: PHP Startup: FirstPHPExt Module: Unable to initialize module Module compiled with build ID=API20090626,TS PHP compiled with build ID=API20090626,TS,VC9 These options need to match in Unknown on line 0 Why it doesn't says that I compiled the module with VC9 ? More info: Operating System: Windows7 x64 PHP: 5.3.3,TS,VC9 Ok, I found the solution: You must add a

Trying to get imagick running on PHP 5.4.3 at Windows x64

爷,独闯天下 提交于 2019-11-30 20:26:27
I have Windows 7 64 bits, PHP 5.4.3 installed through WAMP 2.2 and imagick ( ImageMagick-6.8.3-9-Q16-x64-dll.exe ). I tried to use the php's dll of imagick from a lot of sources but all of them give this error in apache_error.log: PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.4.3/ext/php_imagick.dll' - %1 is not a valid Win32 application.\r\n in Unknown on line 0 Any thoughts on how to solve this? an_animal perhaps this can help you: step-by-step instructions for installing IMAGEMAGICK on WAMP? and http://www.elxsy.com/2009/07/installing-imagemagick-on-windows

PHP 5.3+ enable_dl not enabling dl()?

浪子不回头ぞ 提交于 2019-11-30 20:14:48
I am trying to install a 3rd party PHP extension (.so) into PHP 5.3.6-13 on Ubuntu 11.10 and use it in a web environment. The vendor's documentation suggests using the dl() function to dynamically load the library. When I try their example code, I find the dl() isn't available (Fatal error: call to undefined function dl()) as dl() function was deprecated in PHP 5.3. But there is an enable_dl config rule in php.ini, and other sources say that I should be able to use dl() simply by changing the php.ini variables ( enable_dl=On , safe_mode=Off , not listed in disable_functions ) and restarting

Linking a PHP Extension Written in C

随声附和 提交于 2019-11-30 15:57:14
Edit: Revising My Question When building an external PHP module in C, how do I link shared objects? If your C extension code uses a shared library, you need to declare that in the config.m4 file. I strongly recommend using the ext_skel script that's included in the PHP source to generate a skeleton config.m4: ./ext_skel --extname=myextension Since you're linking to a library, by convention you should use the --with-myextension options (as opposed to --enable-myextension ). Uncomment the relevant lines in the config.m4 and fill in the details of your lib. Something like the following: # --with