php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80579 Can't build php if there is a space in the containing folder
Submitted: 2021-01-03 17:09 UTC Modified: 2021-03-27 10:58 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: fmichaut74 at gmail dot com Assigned: petk (profile)
Status: Duplicate Package: Compile Failure
PHP Version: 8.0.0 OS: Linux - Fedora 31
Private report: No CVE-ID: None
 [2021-01-03 17:09 UTC] 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.




Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-01-06 13:53 UTC] 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-08 01:52 UTC] 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-03-26 21:10 UTC] petk@php.net
-Assigned To: +Assigned To: petk
 [2021-03-27 10:57 UTC] petk@php.net
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
 [2021-03-27 10:58 UTC] petk@php.net
-Status: Assigned +Status: Duplicate
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 11:01:30 2024 UTC