php-extension

In a PHP extension, recommended way to return the value from and std::string

…衆ロ難τιáo~ 提交于 2019-12-11 03:45:15
问题 We have a simple PHP function, whose purpose is to call a C++ free function std::string callLibrary(std::string) and to return its std::string return value. It currently looks like that: PHP_FUNCTION(call_library) { char *arg = NULL; size_t arg_len, len; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &arg, &arg_len) == FAILURE) { return; } // Call underlying library std::string callResult = callLibrary(arg); zend_string * result = zend_string_init(callResult.c_str(), callResult.size(), 0);

Priority between spl_autoload_register and extension's function?

…衆ロ難τιáo~ 提交于 2019-12-11 03:37:07
问题 I use composer to manage my dependencies and class loading. This tool uses spl_autoload_register function. I would like to use a PHP's extension that provides some classes with same definition (name, namespacing, functionnalities) than others classes defined throught composer . Which class will PHP load? The extension's one, or the autoload's one, or maybe the PHP's comportment is undefined? 回答1: PHP will use the extension's one. This is because autoloading will only happen if you are

PHP-FPM pool status of process last-request-cpu

陌路散爱 提交于 2019-12-11 03:07:27
问题 I have installed a PHP and enable the FPM function, but i feel uncertain about the FPM status data(like the process last-request-cpu), below is my php-fpm.conf detail. [www] ; Unix user/group of processes user = www-data group = www-data ; Chdir to this directory at the start. chdir = / ; The address on which to accept FastCGI requests. listen = /var/run/phpfpm/$pool_php5-fpm.sock ; Set listen(2) backlog. A value of '-1' means unlimited. listen.backlog = -1 ; Set permissions for unix socket.

Installing extensions to the bundled PHP in OS X

点点圈 提交于 2019-12-10 18:04:38
问题 I needed to connect to an SQL Server from PHP on OS X 10.9, so I did: brew install php55 brew install php55-pdo-dblib This worked nicely, but I'm wondering: Is it possible to install the dblib extension (or any other PHP extension) into the bundled version of PHP in OS X, without compiling a totally new version of PHP? Where do you find necessary downloads, and what do you do in general to add extensions to PHP? This is surprisingly unclear after researching the topic. 回答1: The trick is to

Install PHP 7.0 Internationalization extension (Intl) on XAMPP on Mac

二次信任 提交于 2019-12-10 18:01:03
问题 I followed the instructions outlined here: Install PHP Internationalization extension (Intl) on XAMPP on Mac Ran sudo pecl install intl selected the correct files from the Cellar then this error happened: /private/tmp/pear/temp/intl/intl_error.h:24:10: fatal error: 'ext/standard/php_smart_str.h' file not found include ^ 1 error generated. make: *** [php_intl.lo] Error 1 ERROR: `make' failed No matter, did some research and found out that PHP 7.0.8 deprecated php.smart_str.h to php.smart

PHP Zend Engine Extension and static methods

≯℡__Kan透↙ 提交于 2019-12-10 17:43:53
问题 On writing an extension for php (5.3) i want to access the zend_class_entry pointer on a static method. On non static methods i can use the getThis() macro and within Z_OBJCE_P macro like this: zend_class_entry ce* = Z_OBJCE_P(getThis()); Now the problem: on static methods the getThis() macro returns a null pointer, so i can not use the Z_OBJCE_P macro. Has anyone a solution for me to access the zend_class_entry from a static method?? 回答1: it is really interesting: on static methods you can

Where can I find php_svn.dll [closed]

女生的网名这么多〃 提交于 2019-12-10 17:41:35
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 months ago . I recently upgraded to PHP 5.3.5 for windows. I have used the subversion extension on previous versions, but php_svn.dll is not included in the 5.3.5 version. I tried to copy the dll from the previous installation of php, but I get this message when trying to start php. PHP Warning: PHP Startup: svn: Unable to

How can i enable php extension with .htaccess file

∥☆過路亽.° 提交于 2019-12-10 15:25:57
问题 I need to enable php_intl extension only in a subdomain of my website, so i use the .htaccess file to do it with this code. <IfModule mod_php4.c> php_extension_dir php_intl.dll php_extension php_intl.dll </IfModule> But not work. Someone helpe me, please? 回答1: The directive php_extension_dir should be: php_extension_dir <path_to__php_extensions> Where <path_to_php_extensions> is the absolute path to where your PHP extensions are installed. Simply putting the file name here does nothing, since

Can't Enable PHP Extensions on php.ini on App Engine for Laravel

假如想象 提交于 2019-12-10 15:09:07
问题 I'm trying to enable some php extensions needed by Laravel. The documentation for the php.ini file (https://cloud.google.com/appengine/docs/php/config/php_ini) says to place a php.ini file in the root of the application. This is what my php.ini looks like: extension=openssl.so extension=pdo.so extension=tokenizer.so extension=mbstring.so google_app_engine.enable_functions = "php_sapi_name, php_uname" When I deploy it, my log says: PHP Warning: PHP Startup: Unable to load dynamic library '

Install PHP intl extension on MacOS

╄→гoц情女王★ 提交于 2019-12-10 13:55:07
问题 I am facing some issues in the installation of Cakephp. I hope any one had faced the same issue. The error - cakephp/cakephp 3.3.9 requires ext-intl * -> the requested PHP extension intl is missing from your system. As per the error message, I removed ; from php.ini file but still getting the same error. I have Mac 10.12 Sierra, Xampp 5.6.28-1 version and PHP 5.6.24 version. 回答1: Install the php5-intl extension brew install php56-intl If you get No available formula for php56-intl do brew tap