php-extension

unloading php extensions : reverse dl()

落花浮王杯 提交于 2019-12-23 12:23:09
问题 To you gurus out there, is there any hidden gem in PHP that could unload a specific extension at runtime ? 回答1: No, that's not possible and most likely never will: [2011-02-08 11:34 UTC] rasmus@php.net extension unloading on a per-request basis simply isn't feasible from a performance point of view. And you obviously can't unload and leave it unloaded for the next request because that next request may be for a page that expects the extension to be there. However, using dl() is discouraged

PHP modules don't load after installing PHP 7 to my server

最后都变了- 提交于 2019-12-23 09:27:59
问题 I installed PHP 7 to my server (as a result, I have not /etc/php5 and /etc/php/7.0). When I run my web app, I cant see any of my previous CURL (or fork). at first I got this err msg: Message: Call to undefined function curl_init() and after installing php7-curl i get it enabled - approved on info() function and this test code: var_dump(_isCurl()); function _isCurl(){ return function_exists('curl_version'); } returning TRUE. but when having an actual CURL in my code I get this error: PHP

Renaming Functions during runtime in PHP

空扰寡人 提交于 2019-12-23 08:05:13
问题 In PHP 5.3 is there a way to rename a function or "hook" a function. There is the rename_function() within "APD" which has been broken since ~2004. If you try and build it on PHP 5.3 you'll get this error: 'struct _zend_compiler_globals' has no member named 'extended_info' This is a really easy error to fix, just change this line: GC(extended_info) = 1; to CG(compiler_options) |= ZEND_COMPILE_EXTENDED_INFO; I modified my php.ini and the APD shows up in my phpinfo() as it should. However when

Writing a PHP extension in something other than C or C++

流过昼夜 提交于 2019-12-23 06:17:07
问题 I'm thinking of writing a PHP extension module but can't tolerate the idea of messing with C or, for that matter, C++. I know that some languages provide compatibility with C APIs, Pascal being one of them, sorry for mentioning it. And I quite suppose that, since the days of Wirth, a further number of languages have appeared that ditch the memory juggling but keep being compiled to native binaries and provide interoperability with all the other programs and libraries out there. Only I didn't

Reading Excel xlsx files in PHP without ZipArchive class or PHP extension php_zip enabled

扶醉桌前 提交于 2019-12-23 05:29:17
问题 I am using PHPExcel PHP library for reading xlsx files and every thing is fine. when I am deploying my web application in our server I am facing the below error: Fatal error: Uncaught exception 'Exception' with message 'ZipArchive library is not enabled' I know that ZipArchive is a requirement for PHP Excel. and I need to follow the install instructions for it to enable it on my production server. This error because PHPExcel require the below requirements: PHP version 5.2.0 or higher PHP

Different API number for PHP extension

那年仲夏 提交于 2019-12-23 04:52:48
问题 So this is the case, I am trying to develop an php-extension for my customers. I use SWIG for generating the wrapper code and my main code is c++. After I create my extension successfully I load it in /ext and restart the web server for testing it. I've got the error which mentioned that the extension has been built with API 20090626 but the PHP server(in my case XAMPP) API is 20100525. I totally understand the error, so I open the Zend_modules.h header file in php source and change the API

PHP extension wrapper for C++ [closed]

感情迁移 提交于 2019-12-22 11:44:29
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 6 years ago . I am new in this area of writing extension for PHP, however I need to create a wrapper class for C++ to PHP. I am currently using PHP 5.2.13. I read this

Passing a variable by reference into a PHP extension

末鹿安然 提交于 2019-12-22 04:28:05
问题 I'm writing a PHP extension that takes a reference to a value and alters it. Example PHP: $someVal = "input value"; TestPassRef($someVal); // value now changed What's the right approach? 回答1: Edit 2011-09-13 : The correct way to do this is to use the ZEND_BEGIN_ARG_INFO() family of macros - see Extending and Embedding PHP chapter 6 (Sara Golemon, Developer's Library). This example function takes one string argument by value (due to the ZEND_ARG_PASS_INFO(0) call) and all others after that by

phpredis extension doesn't work, unable to load 'redis.so'

血红的双手。 提交于 2019-12-22 04:18:08
问题 I installed nginx, php, php-fpm, php-pecl-redis by yum. All of them work but the last one. When I run /usr/sbin/php-fpm , I got this: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/redis.so' - /usr/lib/php/modules/redis.so: undefined symbol: igbinary_unserialize in Unknown on line 0 I don't know what "igbnary_unserialize" means and how to fix it. I checked the redis.so file under right path. I add extension=redis.so to "php.ini" php version: 5.3.3 phpredis

zeromq php extension for windows

眉间皱痕 提交于 2019-12-21 21:29:04
问题 I am using Zend server configured with IIS 7.5. I searched for edit: zeromq php extension, I found these http://valokuva.org/builds/ and http://snapshot.zero.mq/ I have tried to add extension in php.ini and when I enable it form zend admin it shows an error "The system could not load this extension" and in logs "PHP Startup: Unable to load dynamic library 'C:\Program Files\Zend\ZendServer\lib\phpext\php_zmq.dll' - The specified module could not be found. in Unknown on line 0". I have tried to