php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40038 C++ compiler cannot create executables
Submitted: 2007-01-05 22:05 UTC Modified: 2007-01-09 23:32 UTC
From: ionut dot aivanesei at amdocs dot com Assigned:
Status: Not a bug Package: Compile Failure
PHP Version: 5.2.0 OS: HP-UX, AIX
Private report: No CVE-ID: None
 [2007-01-05 22:05 UTC] ionut dot aivanesei at amdocs dot com
Description:
------------
When compiling PHP 5.2.0 on HP and AIX I get:
configure: error: installation or configuration problem: C++ compiler cannot create executables.

On the same servers (3 HP<11.11|11.23> and 1 AIX) i succeded to compile PHP 5.1.6 and also MySQL, Apache HTTPD, limxml2, openldap, libmcrypt, etc.

Also, PHP 5.2.0 (and all others) I succeded to compile on other 4 SunOS servers.


Reproduce code:
---------------
./configure --prefix=...


Expected result:
----------------
everythig should be OK

Actual result:
--------------
...
Configuring libtool
checking build system type... hppa2.0w-hp-hpux11.11
checking for non-GNU ld... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... no
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -p
checking how to recognise dependent libraries... file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library
checking for object suffix... o
checking for executable suffix... no
checking for c++... no
checking for g++... no
checking for gcc... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl... no
checking whether the C++ compiler (gcc   ) works... no
configure: error: installation or configuration problem: C++ compiler cannot create executables.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-01-05 22:11 UTC] iliaa@php.net
Check your config.log and see what happened. The check 
involved is a standard compiler check (not unique to PHP).
 [2007-01-05 22:14 UTC] ionut dot aivanesei at amdocs dot com
I will also add here the beginning of the configure command:

--------------------------------------------------
creating cache ./config.cache
checking for Cygwin environment... no
checking for mingw32 environment... no
checking for egrep... grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking host system type... hppa2.0w-hp-hpux11.11
checking target system type... hppa2.0w-hp-hpux11.11
checking for gcc... no
checking for cc... cc
checking whether the C compiler (cc  ) works... yes
checking whether the C compiler (cc  ) is a cross-compiler... no
checking whether we are using GNU C... no
checking whether cc accepts -g... yes
checking whether cc understands -c and -o together... yes
checking how to run the C preprocessor... cc -E
checking for AIX... no
checking whether ln -s works... yes
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... no
checking for re2c... no
configure: warning: You will need re2c 0.9.11 or later if you want to regenerate PHP parsers.
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking for bison... no
checking for byacc... no
checking for bison version... invalid
configure: warning: bison versions supported for regeneration of the Zend/PHP parsers: 1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 (found: none).
checking for flex... flex
checking for yywrap in -lfl... no
checking lex output file root... lex.yy
checking whether yytext is a pointer... no
checking for working const... yes
checking for flex version... 2.5.4 (ok)
checking whether to force non-PIC code in shared modules... no
checking for pthreads_cflags... -mt
checking for pthreads_lib...

Configuring SAPI modules
...

Thanks,
Ionutz
 [2007-01-05 22:22 UTC] iliaa@php.net
We need the config.log data not the output of configure 
 [2007-01-05 22:22 UTC] ionut dot aivanesei at amdocs dot com
hi iliaa,

these are the last lines from my config.log file:

---------------------------------------------
...
configure:104279: checking for stdarg.h
configure:105262: checking build system type
configure:105324: checking for non-GNU ld
configure:105363: checking if the linker (/usr/bin/ld) is GNU ld
configure:105383: checking for /usr/bin/ld option to reload object files
configure:105408: checking for BSD-compatible nm
configure:105454: checking how to recognise dependent libraries
configure:105632: checking for object suffix
configure:105638: cc -c -I/usr/include -g  conftest.c 1>&5
configure:105658: checking for executable suffix
configure:105668: cc -o conftest -I/usr/include -g    conftest.c  1>&5
configure:105859: checking for c++
configure:105859: checking for g++
configure:105859: checking for gcc
configure:105859: checking for CC
configure:105859: checking for cxx
configure:105859: checking for cc++
configure:105859: checking for cl
configure:105891: checking whether the C++ compiler (gcc   ) works
configure:105907: gcc -o conftest     conftest.C  1>&5
./configure[105906]: gcc:  not found.
configure: failed program was:

#line 105902 "configure"
#include "confdefs.h"

int main(){return(0);}
 [2007-01-05 22:26 UTC] ionut dot aivanesei at amdocs dot com
for some reason it tries to use gcc instead of cc as it should (as it used in the first part of configure).
 [2007-01-05 22:27 UTC] iliaa@php.net
The problem is that configure script cannot find GCC 
(compiler) as you can tell from this line: 
./configure[105906]: gcc:  not found.

If you do have GCC you need to modify your PATH environment 
variable to contain the directory holding your gcc binary.
 [2007-01-05 22:30 UTC] ionut dot aivanesei at amdocs dot com
i dont have gcc.
i am using the HP-UX compiler. It worked fione until version 5.2.0
 [2007-01-05 22:33 UTC] ionut dot aivanesei at amdocs dot com
here is the full config.log file
http://www.devel.ro/config.log
 [2007-01-06 13:07 UTC] ionut dot aivanesei at amdocs dot com
You have here the full configure output and the config.log file for version 5.1.6 and 5.2.0, with the mention that 5.1.6 it is completed succesfully and 5.2.0 is not (both on the same server/configuration).

http://www.devel.ro/hpux11.11--php-5.1.6--config.log
http://www.devel.ro/hpux11.11--php-5.1.6--configure_output.txt
http://www.devel.ro/hpux11.11--php-5.2.0--config.log
http://www.devel.ro/hpux11.11--php-5.2.0--configure_output.txt

Let me know if you need somethign else.

Thanks,
Ionutz
 [2007-01-08 18:15 UTC] ionut dot aivanesei at amdocs dot com
Hi,

Can I send you something else from my configuration to be able to track this down?

Thanks,
Ionutz
 [2007-01-08 20:50 UTC] iliaa@php.net
Given that you don't have GCC, you should export environment 
variable CC and set it to the path of your compiler.

Ex. export CC=/path/to/compiler.bin
 [2007-01-08 21:04 UTC] ionut dot aivanesei at amdocs dot com
It is exported. And the result is still the same.
 [2007-01-09 12:35 UTC] ionut dot aivanesei at amdocs dot com
I managed to run a succesfull configure && make && make install by removing all the lines from line #105853 to line #106048 from the ./configyre script.

Any way, I think that this should be fixed somehow.
 [2007-01-09 23:32 UTC] iliaa@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

The problem seems that you don't appear to have c++ compiler 
based on the paths PHP looks for. So eventually it tries GCC 
and fails to find it, aborting the compilation process.

If "cc" on your system is a C++ compiler you can fix the bug 
by symlinking it as cxx or c++ or even cc++.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon May 12 15:01:27 2025 UTC