Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.10.15

Bug #17016 Windows: PEAR Installation go-pear.bat config variable php_suffix
Submitted: 2010-01-20 21:03 UTC
From: amohr Assigned:
Status: Open Package: PEAR (version 1.9.0)
PHP Version: 5.3.1 OS: Windows 2008 Server 64bit
Roadmaps: (Not assigned)    
Subscription  


 [2010-01-20 21:03 UTC] amohr (Andreas Mohr)
Description: ------------ I believe go-pear.bat creates a wrong parameter in pear.ini which leads to an error message "config variable php_suffix does not match" when commiting PEAR or PECL commands in Wondows environments. Or php_suffix is compared to a wrong value. Theres a lot of frustration on the web about problems with php_suffix variable and missing .dsp files - but no solutions. I can hopefully contribute to solve respectively clarify that a bit. During installation of PEAR using go-pear.bat it is required to enter a correct paramater for Path to CLI php.exe. Entering only the path leads to an error message. The complete path to php.ini is required to be configured for the installation to succeed (allthough commonly the "php binary" under windows is pointed at like c:\php without php.exe). So the following must be entered: 12. Path to CLI php.exe: C:\progs\php\php.exe ***** In effect the Env Var vor PHP_PEAR_PHP_BIN is set to the complete Path "PHP_PEAR_SYSCONF_DIR"="c:\\progs\\php" "PHP_PEAR_INSTALL_DIR"="c:\\progs\\php\\pear" "PHP_PEAR_DOC_DIR"="c:\\progs\\php\\docs" "PHP_PEAR_BIN_DIR"="c:\\progs\\php" "PHP_PEAR_DATA_DIR"="c:\\progs\\php\\data" "PHP_PEAR_PHP_BIN"="C:\\progs\\php\\php.exe" "PHP_PEAR_TEST_DIR"="c:\\progs\\php\\tests" ***** To verify my PEAR installation I installed Web Package Manager c:\progs\php>pear install PEAR_Frontend_Web-0.7.4 ***** I Copied index.php to a webserver location and verified frontend functionality, which is good. Assuming the PEAR configuration is correct, I proceeded with the installation of a PEAR Package (in my case: Enchant): **** I tried: c:\progs\php>pecl install enchant downloading enchant-1.1.0.tgz ... Starting to download enchant-1.1.0.tgz (9,464 bytes) .....done: 9,464 bytes 4 source files, building WARNING: php_bin C:\progs\php\php.exe appears to have a suffix \php.exe, but config variable php_suffix does not match ERROR: The DSP enchant.dsp does not exist. **** Then I tried: c:\progs\php>pecl bundle enchant downloading enchant-1.1.0.tgz ... Starting to download enchant-1.1.0.tgz (9,464 bytes) .....done: 9,464 bytes Package ready at 'c:\progs\php\ext\enchant' **** So: bundeling seems OK... so I tried building: c:\progs\php>pecl build enchant WARNING: php_bin C:\progs\php\php.exe appears to have a suffix \php.exe, but config variable php_suffix d oes not match Unable to open enchant ***** ...Note: the .dsp is not mentioned in this message... ***** First thing I tried then is to modify the value in pear.ini with text editor: ...s:12:"c:\progs\php"... ***** Result: c:\progs\php>pecl build enchant Notice: unserialize(): Error at offset 434 of 556 bytes in Config.php on line 1050 ERROR: The default config file is not a valid config file or is corrupted. ***** I changed the value back my text editor to ...s:12:"c:\progs\php\php.exe"... which resolved the "corrupt" message. I switched to the Web frontend package manager and modified the configuration there. I changed the following to values (the latter was empty): PHP CLI/CGI binary: c:\progs\php php.ini location: c:\progs\php ***** I saved the configuration and got the following two results: c:\progs\php>pecl build enchant Unable to open enchant c:\progs\php>pecl install enchant downloading enchant-1.1.0.tgz ... Starting to download enchant-1.1.0.tgz (9,464 bytes) .....done: 9,464 bytes 4 source files, building ERROR: The DSP enchant.dsp does not exist. ***** This might be a clue: I observed following behaviour in pear.ini on saving the configuration using the web frontend When changing the value for PHP CLI/CGI binary, the parameter ...s:12:"c:\progs\php"... changes to ...s:20:"c:\progs\php\php.exe"... (S:25 in a second try) when I change back to the "correct" value it changes back to ...s:12:"c:\progs\php"... ***** In the Web Frontend Package Manager I do not understand the parameters needed for "--program-prefix passed to PHP's ./configure:" And could not find documentation on theses parameters. Possibly this has to do with the "missing .dsp file" message...? After my tests (see above) I find Enchant data in three different Locations. I do not understand why. I would not expect anything to go to the php/ext directory that is not compiled. c:\progs\php\ext\enchant (seems to be complete w. 14 files and 3 folders incl. credits and enchant-1.1.0.tgz) c:\progs\php\tmp\enchant (only for files containing .m4, .w32, .h and .c) c:\progs\php\tmp\enchant-1.0.1 (seems to be complete w. 13 files and 3 folders but no credits and no tar) Last but not least, the answer to the question often postet on the web that leads to some frustration: What is a .dsp file? (Refer to ERROR: The DSP enchant.dsp does not exist. above). For anyone who gets here looking for answers - working in a MS environment DSP is commonly associated with Microsoft Developer Studio project. I did not manage to compile PHP Code of the enchant sources yet using Visual C++ Express 2008 - it seems to be time consuming for beginners. If anyone needs to go throught it, the following offers good reference: http://blog.astrumfutura.com/archives/327-Compiling-PHP-for-Windows-Vista-using-Visual-C++-Express-2008-Seriously!.html http://www.phpbuilder.com/manual/en/install.windows.building.php I for my part decided not to use Enchant or any other .dll that is not released (for Windows)... for now. I now use Environment Variable PHP_PEAR_PHP_BIN = c:\progs\php\php.exe and "PHP CLI/CGI binary" = c:\progs\php for the best possible running state: c:\progs\php>PEAR install Enchant No releases available for package "pear.php.net/Enchant" - package pecl/Enchant can be installed with "pecl install Echant" install failed c:\progs\php>PECL install enchant downloading enchant-1.1.0.tgz ... Starting to download enchant-1.1.0.tgz (9,464 bytes) .....done: 9,464 bytes 4 source files, building ERROR: The DSP enchant.dsp does not exist. Maybe when the Error message is printed out you could also print out the hint that the "PHP SDK" is needed for creating a .dsp file or that under Windows, this Extension needs to be manually compiled with whatever method... Test script: --------------- - Install PHP 5.3.1 on a Windows 2008 System - Use go-pear.bat to install pear. - For Path to CLI php.exe try to use c:\php, note the Error Message. Use c:\php\php.exe and submit - After the installation, try to issue "PECL INSTALL Enchant" command. Note the warning "php_suffix does not match". - Issue the command "pear install PEAR_Frontend_Web-0.7.4" do the necessary copying and open the Web Frontend - In the configuration, change the value for PHP CLI/CGI binary from c:\progs\php\php.exe to c:\progs\php. Save the configuration - Issue the command "PECL INSTALL Enchant" again and note that the message "php_suffix does not match" is gone. Expected result: ---------------- Its not a script. But after successfully installing PEAR under windows with no error message or warning using go-pear.bat, the PECL Install $Extension command should run without showing the message "php_suffix does not match". The PECL command provides a .dsp file and installs or compiles the enchant extension correctly. Otherwise a hint is given how to resolve the issue or what to look for. Is that a result of "compilation failed" or "preparation of compilation failed because xyz.file is missing or it simply does not work under Windows and needs to be compiled manually"... I would expect to find documentation on the PEAR Website what is to be done if "No releases" are "available for package" for Windows users (I.e. if no releases are available and you are a windows user you need to manually compile using gnu make or whatever). Actual result: -------------- After successfully installing PEAR under windows with no error messages or warnings using go-pear.bat, the PECL Install $Extension command runs showing the Warning "php_suffix does not match". ERROR: The DSP enchant.dsp does not exist. is shown.

Comments

 [2010-01-21 14:50 UTC] amohr1 (Andreas Mohr)
As I see in the description of the preceeding bug it is recommended to configure PEAR to use the cgi version of the php binary if it exists. I changed configuration using Pear Web Frontent Package Manager (because changing the value with a text editor renders pear.ini useless) for "PHP CLI/CGI binary:" to c:\progs\php\php-cgi.exe. Now the s value is 24 (whatt? why?) s:24:"c:\progs\php\php-cgi.exe" I also changed the environment Variable PHP_PEAR_PHP_BIN to c:\progs\php\php-cgi.exe I restarted the system to make sure everything is reset. Here are the results - note the different locations of the tgz´s --------------------------------------------- Microsoft Windows [Version 6.0.6002] Copyright (c) 2006 Microsoft Corporation. All rights reserved. c:\progs\php>pear install enchant No releases available for package "pear.php.net/enchant" - package pecl/enchant can be installed with "pecl install enchant" install failed c:\progs\php>pecl download enchant downloading enchant-1.1.0.tgz ... Starting to download enchant-1.1.0.tgz (9,464 bytes) .....done: 9,464 bytes File c:\progs\php\enchant-1.1.0.tgz downloaded c:\progs\php>pecl bundle enchant downloading enchant-1.1.0.tgz ... Starting to download enchant-1.1.0.tgz (9,464 bytes) .....done: 9,464 bytes Package ready at 'c:\progs\php\ext\enchant' c:\progs\php>pecl build enchant WARNING: php_bin c:\progs\php\php-cgi.exe appears to have a suffix \php-cgi.exe, but config variable php_suffix does not match Unable to open enchant ------------------------------------------------------- It would really help to know where the "config variable php_suffix" is exactly taken from.
 [2010-01-21 16:58 UTC] amohr (Andreas Mohr)
One step further. I dug into the surces and found the following in C:\progs\php\PEAR\PEAR\config.php 'php_prefix' => array( 'type' => 'string', 'default' => '', 'doc' => '--program-prefix for php_bin\'s ./configure, used for pecl installs', 'prompt' => '--program-prefix passed to PHP\'s ./configure', 'group' => 'File Locations (Advanced)', ), 'php_suffix' => array( 'type' => 'string', 'default' => '', 'doc' => '--program-suffix for php_bin\'s ./configure, used for pecl installs', 'prompt' => '--program-suffix passed to PHP\'s ./configure', 'group' => 'File Locations (Advanced)', ), This encouraged me to go to the Package Manager Web Frontend (because directly editing pear.ini makes it useless) and changed the following values --program-prefix passed to PHP's ./configure: c:\progs\php --program-suffix passed to PHP's ./configure: \php-cgi.exe The Environment variable (the one I believe to be relevant) points to php-cgi.exe PHP_PEAR_PHP_BIN = c:\progs\php\php-cgi.exe I restarted the server to make sure all configuration is set. PECL commands now return: --------------------------------- c:\progs\php>pear install enchant No releases available for package "pear.php.net/enchant" - package pecl/enchant can be installed with "pe cl install enchant" install failed c:\progs\php>pecl download enchant downloading enchant-1.1.0.tgz ... Starting to download enchant-1.1.0.tgz (9,464 bytes) .....done: 9,464 bytes File c:\progs\php\enchant-1.1.0.tgz downloaded c:\progs\php>pecl bundle enchant downloading enchant-1.1.0.tgz ... Starting to download enchant-1.1.0.tgz (9,464 bytes) .....done: 9,464 bytes Package ready at 'c:\progs\php\ext\enchant' c:\progs\php>pecl build enchant Unable to open enchant --------------------------------- Especially notable is now that there is no more hint on a missing .dsp file. The question is if that is a good sign. All Errors and Warnings are gone. For debugging: a) the configuration of php_suffix is not documented. I seems odd, that the values can only be modified in the Package Manager Web Frontend, which is only" Beta. And it seems odd theat the value for php_suffix must be given with a preceding backslash. Is that correct? b) If the above is correct, I believe that these values should be set during the installation using go-pear.bat c) It is still unclear why the build fails to open. Is it impossible to "PECL build" unreleased packages in a windows environment at all? Or is some "PHP SDK" or "Make Command from GNU" missing? Or - being a windows user - do I need to manually build Enchant using Visual Studio because "You can´t always get what you want"?
 [2010-09-21 20:17 UTC] konqi (Marcel Silberhorn)
try to set php_sufgfix with $ pecl config-set php_suffix .exe
 [2011-02-12 07:59 UTC] jojo (jojo zhao)
after I try to set php_sufgfix with $ pecl config-set php_suffix .exe get below: c:\PHP_CI_env>pecl config-set php_suffix .exe config-set succeeded then I try: c:\PHP_CI_env>pecl install xdebug downloading xdebug-2.1.0.tgz ... Starting to download xdebug-2.1.0.tgz (301,354 bytes) ................done: 301,354 bytes 66 source files, building ERROR: The DSP xdebug.dsp does not exist. the dsp error still be there. what's wrong?
 [2012-04-20 02:21 UTC] brentnewland (Brent Newland)
pecl config-set php_suffix \php-cgi.exe pecl config-set php_bin C:\pathto\php\php-cgi.exe PEAR\Builder.php: Line 109 to "return $this->raiseError("The DSP $dir/$dsp does not exist.")" (add the "$dir/") It appears the temp directory gets destroyed before the install phase.
 [2012-09-28 23:41 UTC] felipemanchu (Felipe Orellana)
I have the same problem, and spent some time tracing this. The issue is not that the temporary folder gets deleted is that the package is extracted outside of the temporary folder. then when the builder fails to find the extracted package folder it fails and deletes the temporary folder afterwards. Hope, that helps some. Still looking to correct this myself. I will post back if/when I do.
 [2013-10-05 23:33 UTC] jcdr (Jean De Ryck)
... I'VE LOST THE WHOLE DAY ON THIS !!! To finally find that the bug comes from the RegExp in builder.php line 245: if (preg_match('/(\\/|\\\\|^)([^\\/\\\\]+)?php(.+)?$/', $this->config->get('php_bin'), $matches)) { I am using EasyPHP with php_bin = "C:\Program Files\EasyPHP-DevServer-13.1VC11\binaries\php\php_runningversion\php.exe", so the RegExp returns: array (size=4) 0 => string '\php\php_runningversion\php.exe' (length=31) 1 => string '\' (length=1) 2 => string '' (length=0) 3 => string '\php_runningversion\php.exe' (length=27) Line 3 should be "php.exe", hence the bug. BUG: Line 5471 of installer go-pear.phar should be changed from: if (preg_match('/(\\/|\\\\|^)([^\\/\\\\]+)?php(.+)?$/', to: if (preg_match('/(\\/|\\\\|^)([^\\/\\\\]+)?php([^\\/\\\\]+)$/', For those who already installed PEAR, just change the RegExp in builder.php. I cannot believe that PEAR developers have left this bug open for nearly four years, with hundreds of complaints all over the web.
 [2013-10-05 23:44 UTC] jcdr (Jean De Ryck)
Sorry, deleted the second question mark. It should be if (preg_match('/(\\/|\\\\|^)([^\\/\\\\]+)?php([^\\/\\\\]+)?$/',
 [2013-12-06 02:27 UTC] camilord (Camilo Lozano III)
i have the same problem.. :( C:\php>pecl install xdiff downloading xdiff-1.4.1.tgz ... Starting to download xdiff-1.4.1.tgz (8,623 bytes) .....done: 8,623 bytes 4 source files, building WARNING: php_bin C:\php\php.exe appears to have a suffix \php.exe, but config variable php_suffix does not match ERROR: The DSP xdiff.dsp does not exist. C:\php>pecl config-set php_suffix \php-cgi.exe config-set succeeded C:\php>pecl config-set php_bin c:\php\php-cgi.exe config-set succeeded C:\php>pecl install xdiff downloading xdiff-1.4.1.tgz ... Starting to download xdiff-1.4.1.tgz (8,623 bytes) .....done: 8,623 bytes 4 source files, building ERROR: The DSP xdiff.dsp does not exist. C:\php>pecl install xdiff downloading xdiff-1.4.1.tgz ... Starting to download xdiff-1.4.1.tgz (8,623 bytes) .....done: 8,623 bytes 4 source files, building ERROR: The DSP C:\php\tmp\pea6EC0.tmp/xdiff.dsp does not exist.
 [2013-12-31 08:59 UTC] seryoga (Seryoga Ivanov)
This error: "WARNING: php_bin .\php.exe appears to have a prefix php.exe, but config variable php_prefix does not match" fixing by set option in console (see above): $ pecl config-set php_suffix .exe And about error with missing DSP file check this: https://bugs.php.net/bug.php?id=59310 >pecl does not support src install on windows. For example xdiff cant install through console in windows, it possible to download from web http://windows.php.net/downloads/pecl/releases/xdiff/