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-01-06 13:53 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:
Status: Open Package: Compile Failure
PHP Version: 8.0.0 OS: Linux - Fedora 31
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: fmichaut74 at gmail dot com
New email:
PHP Version: OS:

 

 [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

Add a Patch

Pull Requests

Add a Pull Request

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"
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Mar 08 02:01:26 2021 UTC