php-extension

Creating static libraries

时光毁灭记忆、已成空白 提交于 2019-12-12 07:39:40
问题 I'm trying to create a static library to use inside my PHP extension. To do that, I'm compiling my .c files using gcc -c file.c -o file.o and obtaining .o files. I then use ar rcs lib.a *.o to archive all the compiled objects into an .a file. After doing this, I'm referring to this .a file when compiling my PHP extension, but I get the following error: *** Warning: Linking the shared library <extension>.la against the *** static library lib.a is not portable! If I use the .o files instead of

How to enable PHP Intl extension on macOS Mojave?

社会主义新天地 提交于 2019-12-11 17:06:14
问题 I'm trying to install Magento (2.3.0) on macOS Mojave. Magento shows PHP Extension intl. is missing. I tried the below to resolve: Made a copy of php.ini using cp /etc/php.ini.default php.ini Removed ";" before extension=php_intl.dll Restart Apache sudo apachectl restart But the above did not resolve. On checking php -v , i'm seeing the below error: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20160303/php_intl.dll' - dlopen(/usr/lib/php

Unable to enable ext-gmp

这一生的挚爱 提交于 2019-12-11 16:18:58
问题 So I've been trying to enable gmp on my macbook pro, but upto no avail. Here's what I've done till now. Uncommented extension=php_gmp.dll in /private/etc/php.ini Uncommented extension=php_gmp.dll in /usr/local/php5/lib/php.ini (coonfiguration file as displayed in phpinfo() ) phpinfo() says gmp is enabled, but when I do php -m , it doesnt shows gmp. What must I do? 回答1: The lines that you're uncommenting are examples. The extension is not actually present on your system -- you need to install

How "not to remove 'php' extension from specific page?

寵の児 提交于 2019-12-11 14:36:28
问题 I am newbie in coding and need your help. I have hidden my .php extension via .htaccess with this code: RewriteEngine on RewriteRule ^(.+)\.php$ /$1 [R,L] RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule ^(.*?)/?$ /$1.php [NC,END] But there is one page (submit.php) where .php extension is required to work my code in that page, otherwise it shows a blank page. Is there any way around to whitelist specific page form not to remove .php extension? 回答1: At the top of your htaccess file ,add the

PHP-CPP C++ Extension Can't Find Regex [duplicate]

ⅰ亾dé卋堺 提交于 2019-12-11 14:04:01
问题 This question already has answers here : Is gcc 4.8 or earlier buggy about regular expressions? (3 answers) Closed 5 years ago . I'm writing a C++ extension for PHP and I'm using regex in my code. Here is a snippet #include <phpcpp.h> #include <regex> #include <iterator> #include <iostream> #include <sstream> #include <string> #include <fstream> #include <stdio.h> using namespace std; Element* parse(std::sregex_iterator iterator, std::sregex_iterator iteratorEnd) { string segmentContent = "";

mysqlnd driver has only one api extension (pdo_mysql)

我的梦境 提交于 2019-12-11 13:53:29
问题 After checking phpinfo() I saw that mysqlnd driver installed on linux (php 5.4) has only one API extension ( pdo_mysql ), but I also want to be able to work with mysqli . How do I associate mysqlnd driver with mysqli extension? I guess I can fix this by reinstalling mysql, but is there any workaround? Please help! Thank you! 回答1: Assuming that you did install mysql correctly. Locate your php.ini by executing phpinfo() or by typing the following command: php --ini look for something like

PHP 7.1+ Windows readline extension not all functions exist

时间秒杀一切 提交于 2019-12-11 12:23:57
问题 One of the improvements in PHP7.1 is that in Windows the readline extension is available out of the box. I'm having trouble using all of the functions though, as they don't all exist. The following code: $functions = [ 'readline_add_history', 'readline_callback_handler_install', 'readline_callback_handler_remove', 'readline_callback_read_char', 'readline_clear_history', 'readline_completion_function', 'readline_info', 'readline_list_history', 'readline_on_new_line', 'readline_read_history',

Passing a variable by reference into a PHP7 extension

邮差的信 提交于 2019-12-11 12:18:48
问题 I followed the steps mentioned at Passing a variable by reference into a PHP extension for Passing a variable by reference into a PHP extension. This is working fine for PHP 5 but when I try the same in Php7 and its not working. Any suggestions? Here is my code snippet. ZEND_BEGIN_ARG_INFO(params_ref_arg_arginfo, 0) ZEND_ARG_INFO(1, a) ZEND_END_ARG_INFO() PHP_FUNCTION(sample_byref_compiletime) { zval *a; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &a ) == FAILURE) { php_printf(

How to install gearman extension on MAMP

微笑、不失礼 提交于 2019-12-11 10:58:23
问题 Has anyone ever tried and succeeded to install gearman extension on MAMP? I am trying to do it on MAMP 2.x on a MAC OS X 10.6.8 回答1: You can install the server with homebrew brew install gearman Then download the PECL package here http://pecl.php.net/package/gearman and compile it tar xzf gearman-X.Y.tgz cd gearman-X.Y phpize ./configure make sudo make install Then copy/paste the gearman.so from your default extensions folder (for me /usr/lib/php/extensions/) to your MAMP extensions folder

php_imap.dll for php v 5.2.6 apache for windows

假装没事ソ 提交于 2019-12-11 08:24:26
问题 I am having problems installing the php_imap.dll extension for a webserver running apache and php 5.2.6 on windows server 2003 r2. I have other extensions installed so I know the basics. I have confirmed that my php.ini file is pointing the the right extension directory. This is in my php.ini config extension=php_gd2.dll extension=php_mysql.dll extension=php_mysqli.dll extension=php_imap.dll and I put the php_imap.dll in the /ext folder of apache where the others are located. Then in the php