|  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
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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
48 - 44 = ?
Subscribe to this entry?

 [2021-01-03 17:09 UTC] fmichaut74 at gmail dot com
Downloaded php 8.0 at

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"
taf -xf php-8.0.0.tar.gz
cd php-8.0.0

# 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.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-01-06 13:53 UTC]
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$PATH"
 [2021-03-26 21:10 UTC]
-Assigned To: +Assigned To: petk
 [2021-03-27 10:57 UTC]
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.

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
 [2021-03-27 10:58 UTC]
-Status: Assigned +Status: Duplicate
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 21 02:01:28 2024 UTC