# mod_php build fails, compiler cannot create executables (?)

## numerodix

I was building the newest release of mod_php and however I tried it would not complete. I got messages about libpng missing, I even built that just for the sake of getting rid of the errors even though I don't need it. But finally I get the following error..

 *Quote:*   

> berkdb
> 
> mysql
> 
> libwww
> ...

 

Strange error, I have not upgraded the compiler as far as I can remember, I've also completed various other builds just before trying this one.

----------

## rac

Can you hunt for the config.log file in /var/tmp/portage under the mod_php build directory, and see if there's anything useful in there?

----------

## Sven Vermeulen

Issue 

```

~# env-update

~# source /etc/profile

```

and try again...

----------

## numerodix

Thanks, Sven, that fixed it.  :Smile: 

----------

## rac

If you figure out why your PATH wasn't being set correctly, please let us know.  I'm still collecting data on this topic.

----------

## michal65

The following:

~# env-update

~# source /etc/profile 

did not work for me.  I had to put -java in my USE variable in make.conf, after that it worked fine.  Don't know why but it worked.

----------

## DJ-Static

i had a compile issue with mod_php. (something about Apache2 support)

```
USE="-java -apache2 -qt" emerge mod_php
```

worked fine. figured i'd post this here in case someone else has the same issues.

hope it helps someone  :Smile: 

----------

## funsize

I was having this same problem:

having found both this thread and this one: https://forums.gentoo.org/viewtopic.php?t=13632

I was able to save some of the output...

here is the initial error I received:

 *Quote:*   

> 
> 
> [snip]
> 
> checking for mkfifo... no
> ...

 

also the end of the config.log file located at /var/tmp/portage/mod_php-4.3.1/work/php-4.3.1/config.log

 *Quote:*   

> 
> 
> [snip]
> 
> configure:62658: g++ -o conftest -march=athlon -O3 -pipe  -DHARD_SERVER_LIMIT=512 
> ...

 

there were a number of similar java errors further up in the file...but this is getting pretty long as is, and they seemed to be very similar

after reading these 2 threads...I tried the following:

```

USE="-java" emerge -uD mod_php

```

which seemed to work OK.

It's still compiling, but at the point where it barfed earlier, I received instead:

 *Quote:*   

> 
> 
> checking whether the C++ compiler (g++ -march=athlon -O3 -pipe  -Wl,-rpath,/usr/qt/3/lib 
> 
> -L/usr/qt/3/lib) works... yes
> ...

 

the compile then continued as normal

sorry this post is so long, but I thought I would include as much data as possible...  :Wink: 

----------

## wan-geek

 :Very Happy: 

Earth People, 

I encountered the same issue when trying to emerge mod_php onto a fresh gentoo install.  Apache, mod_ssl, and other packages emerge great...but I received:

"configure: error: installation or configuration problem: C++ compiler cannot create executables."

when trying to get mod_php.

By scanning the other posts...and doing a little digging myself...I came upon a working solution that allows you to use java rather than just disable it for this emerge.

SOLUTION:

---------------

1> first, remove blackdown-jre...it is the cause of the trouble

```

emerge unmerge blackdown-jre

```

2> we are going to emerge jave..but this time from the SOURCE...we're going to use Sun's version.  To do this, you will need to follow the emerge prompts to download the following files from Sun.  If you type "emerge sun-j2ee sun-jdk" it will prompt you with the web-addresses to get these files AND instruct you how to proceed with the emerge.  Or you can find the files yourself on sun's website.

j2sdk-1_4_1_02-linux-i586.bin

j2sdkee-1_3_1-linux.tar.gz

3> Once you have the 2 files...place them in /usr/portage/distfiles 

```

mv j2sdk* /usr/portage/distfiles

```

and type the following:

```

emerge sun-j2ee sun-jdk

```

This will emerge the sun sources for java...and will resolve the issues that blackdown was causing in regards to the "unable to compile" errors.

4> Once these 2 packages are emerged....we need to update the system environment to use sun's java rather than the blackdown version.  This information is set in /etc/env.d/20java.  To modify this file, and have it rebuild itself to use the new java....type the following:

```

java-config --set-source-vm=sun-jdk-1.4.1.02

source /etc/profile

```

5> once all this has completed....try your mod_php emerge again:

```

emerge mod_php

```

This time you should notice that gcc++ CAN build the required files...and the emerge completes.

I'm not sure if this applies across the board for everyone's system....but in my case (a VIRGIN install that is less than 3 days old )..this was the resolution that got mod_php running WITH java support.

Cheers,

Chris Moody - LINUX Architect

Silicon Hotrod Consulting

chris@siliconhotrod.com

619.921.7238

----------

## wan-geek

Ok....now that you have mod_php emerged....I'm sure the next question is going to be "this is fine and dandy chris...but now how do I get php to load under apache?"

Well...per the emerge output at the end of the mod_php compile...you simply need to do the following:

```

*

* To have Apache run php programs, please do the following:

* 1. Execute the command:

*  "ebuild /var/db/pkg/dev-php/mod_php-4.3.1/mod_php-4.3.1.ebuild config"

* 2. Edit /etc/conf.d/apache and add "-D PHP"

*

* That will include the php mime types in your configuration

* automagically and setup Apache to load php when it starts.

```

also...in order to SEE any content, make SURE you edit the "deny from all"

statement in commonapache.conf

I'm also currently running Dynamic Vhosts.  All I need to do is create the directory for the domain (mine is under /chroot/httpd/domains/www.foo.bar) and we're off.  There's not even any need to restart apache.  Just make sure DNS is resolving first as that is how the mod_vhost_alias determines what content to dispay.

~Chris

----------

## WaMan

Just wanted to note that upgrading to 

blackdown-jdk-1.4.1

also will worked for me

----------

