zephir-lang / zephir

Zephir is a compiled high-level language aimed to ease the creation of C-extensions for PHP
https://zephir-lang.com
MIT License
3.29k stars 466 forks source link

Problems with compiled PHP #1834

Open garciac12 opened 5 years ago

garciac12 commented 5 years ago

Hi, for a project I need PHP with ZTS to use Threads. I do this with out problelm and put the new compiled version of php in /opt/php7 directory. I have a little library where I need use Zephir, my problem is, when I make the module, the PHP version for link is the system PHP and not the new one. After a few tests, I found the problem. When the command Compile is executed, and run ./configure, this program is executed with the default configuration of the system, and don't use my new PHP version. The solution is passing the --with-php-config to configure, I change the file Compiler.php in line 889, and put hardcoded line: exec( 'cd ext && export CC="gcc" && export CFLAGS="'. $gccFlags. '" && ./configure --with-php-config=/opt/php7-pmd/bin/php-config --enable-'. $extensionName ); In this case is a solution for me, but the best way is put that in parameter, Is possible add this configuration to the command line ?

Thanks

dreamsxin commented 5 years ago
alias php=php-xxx
# or
export PATH=/path/to/newdir:$PATH
sergeyklay commented 5 years ago

Hello @garciac12

We'll try to sort out with this. Thank you for the idea.