Bug #80579 [Com]: Can't build php if there is a space in the containing folder

From: Date: Sat, 27 Mar 2021 10:57:24 +0000
Subject: Bug #80579 [Com]: Can't build php if there is a space in the containing folder
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-233011@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80579&edit=1 ID: 80579 Comment by: petk@php.net Reported by: fmichaut74 at gmail dot com Summary: Can't build php if there is a space in the containing folder Status: Assigned Type: Bug Package: Compile Failure Operating System: Linux - Fedora 31 PHP Version: 8.0.0 Assigned To: petk Block user comment: N Private report: N New Comment: Issue here is not only in PHP but also in Make. Makefiles don't handle spaces very well and probably it will be easier and faster for you to rename the directories to not include spaces. https://savannah.gnu.org/bugs/?712 Maybe we can prepare a patch for the PHP build system only (in *.sh, *.m4, *.ac files) and after several years later this can be fixed everywhere else when Make gets fixed. This is also a similar issue https://bugs.php.net/bug.php?id=49270 Previous Comments: ------------------------------------------------------------------------ [2021-01-08 01:52:15] krinklemail at gmail dot com This seems to also affect PECL and even when there is merely a space in an unrelated directory part of the PATH (not the current directory or anything like that). For example pecl install apcu ``` $ pecl install apcu downloading apcu-5.1.19.tgz ... Starting to download apcu-5.1.19.tgz (96,583 bytes) .....................done: 96,583 bytes 45 source files, building running: phpize Configuring for: PHP Api Version: 20180731 Zend Module Api No: 20180731 Zend Extension Api No: 320180731 Enable internal debugging in APCu [no] : building in /private/tmp/pear/temp/pear-build-krinklefkT1B3/apcu-5.1.19 running: /private/tmp/pear/temp/apcu/configure --with-php-config=/usr/local/opt/php@7.3/bin/php-config --enable-apcu-debug=no /private/tmp/pear/temp/apcu/configure: line 624: test: /Applications/Sublime: binary operator expected /private/tmp/pear/temp/apcu/configure: line 624: test: /Applications/Sublime: binary operator expected ``` Where "/Applications/Sublime" presumably comes from my bash profile, which contains: export PATH="/Applications/Sublime Text.app/Contents/SharedSupport/bin:$PATH" ------------------------------------------------------------------------ [2021-01-06 13:53:34] nikic@php.net I tried to add quotes to the include paths, but: configure:40308: cc -o conftest -I"/usr/include/valgrind" -I"/home/nikic/php/with whitespace/ext/date/lib" -I"/usr/include/libxml2" -I"/usr/include/x86_64-linux-gnu" -I"/usr/include/enchant-2" -I"/usr/include/glib-2.0" -I"/usr/lib/x86_64-linux-gnu/glib-2.0/include" -I"/usr/include/libpng16" -I"/usr/include/freetype2" -g -fvisibility=hidden -O0 -Wl,-rpath,/build/libjpeg-turbo-6HlDLQ/libjpeg-turbo-2.0.3/obj-x86_64-linux-gnu/lib/x86_64-linux-gnu -L/build/libjpeg-turbo-6HlDLQ/libjpeg-turbo-2.0.3/obj-x86_64-linux-gnu/lib/x86_64-linux-gnu conftest.c -lgmp -lbz2 -lutil -lrt -lm -ldl -lxml2 -lssl -lcrypto -lsqlite3 -lz -lcurl -lxml2 -lenchant-2 -lffi -lssl -lcrypto -lz -lpng16 -lz -lwebp -ljpeg -lXpm -lX11 -lfreetype >&5 cc: error: whitespace/ext/date/lib": No such file or directory Even with -I"/home/nikic/php/with whitespace/ext/date/lib" it seems to get interpreted as a separate directly when running in configure. The same command works when running from the shell :/ ------------------------------------------------------------------------ [2021-01-03 17:09:13] fmichaut74 at gmail dot com Description: ------------ Downloaded php 8.0 at https://www.php.net/distributions/php-8.0.0.tar.gz. I downloaded it in a directory with spaces in it. When I tried to execute the configure script, I got the following error : configure: error: iconv does not support errno Strangely enough, even though this message doesn't seems to be a naming error, the error disapeared when I tried to compile in a path without any spaces in directory names, so it really is an issue with the directory name. Then I wanted to try to compile without iconv to see if it was the only issue. I ran ./configure --without-iconv. The configure step failed with the following error message : /configure: line 59362: test: /tmp/temp/hello: binary operator expected I edited the configure script to fix it, just added some quotes around variables to make the test command succeed. After that, the configure step completed successfully (despite some warnings about sed not finding files). But when I tried to make, there was errors tied to the directory name containing spaces. Test script: --------------- mkdir "hello world" cd "hello world" wget https://www.php.net/distributions/php-8.0.0.tar.gz taf -xf php-8.0.0.tar.gz cd php-8.0.0 ./configure make # I tried the exact same steps but with a directory named HelloWorld and i was able to build php, the errors only occurs with a space in the directory name Expected result: ---------------- I was expecting to be able to build php no matter how the previous directories are named. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=80579&edit=1

« previous php.bugs (#233011) next »