# starting apache, emerging mod_php errors.[SOLVED]

## theme

Hello I'm new in linux, I want to buld a web server and I emerged apache and then mod_php, I did it with the following commands:

```

#emerge -k apache mod_php   --> it didn't work well

#USE="apache2" emerge -k apache mod_php  --> it also didn't work 

#nano -w /etc/make.conf

  inside_make.conf>> USE="apache2 (···)"

#emerge mod_php  --> and nothing the nothing

```

if I emerge only apache it doesn't tells anything suspicious.

and when I emerge mod_php

```

#USE="apache2" emerge mod_php

```

it returns the following messages, which I don't understand   :Crying or Very sad: 

 *Quote:*   

> 
> 
> bash-2.05b# USE="apache2" emerge mod_php
> 
> Calculating dependencies ...done!
> ...

 

on the other hand when I try to run apache with :

```
#/etc/init.d/apache2 start
```

it returns

 *Quote:*   

> 
> 
> bash-2.05b# /etc/init.d/apache2 start
> 
> * Starting apache2...
> ...

 

Can anybody help me?  Thanks   :Wink: Last edited by theme on Sat Sep 11, 2004 12:34 pm; edited 5 times in total

----------

## gojuka

Did you have OpenLDAP previously installed?

You might want to start by emerging OpenLDAP.

If you already have OpenLDAP installed, it is possible that your OpenLDAP was upgraded to a new version. but apache is looking for the older version. In which case you need to re-emerge apache.

Mark

----------

## theme

 :Rolling Eyes:   I don't know what exactly is OpenLDAP. I'll look it tomorrow, today let me lie down to recover energy and tomorrow i'll try.

 I'll report news as soon as possible. 

lots of thanks    :Wink: 

----------

## theme

Oh!! I achieved setting up my eth1 interface while booting and I'm feeling so entusiastic. So I couldn't wait till tomorrow. Ihave already done it and I can start apache!!!!!

Today I'm breaking   :Wink:   thanks to all you ofcourse. 

But I still have the problem of emerging mod_php, it says the same:

 *Quote:*   

> 
> 
>                    (...)
> 
> checking for sys/ipc.h... yes
> ...

 

What can I do to solve it?

----------

## Reverent

I get the same error here for emerging mod_php. I wonder why it tell something about cross compiling ?

Edit: With the normal ./configure i dont get this error

Solution: i emerged not the ebuild directly but instead used emerge mod_php and now it starts compiling...

----------

## theme

I don't understand what do you mean.

----------

## Reverent

i tried to emerge mod_php via full path to the ebuild to avoid upgrade of apache too (using apache1. but dont want to upgrade to apache2). And always got the same error like you. Then i used emerge mod_php instead full path and without -u option, then it started compiling.

----------

## theme

If i do:

```
#emerge mod_php
```

This is what you mean, isn't it?

It returns me the same problem. My kernel has been compiled with genkernel. I don't know if it has to take some influence in it. Then what i need to use mod_php? because to use apache i need openldap.

Well it returns :

 *Quote:*   

> configure: error: can not run test program while cross compiling
> 
> !! ERROR: dev-php/mod_php-4.3.2-r4 failed.
> 
> !!! Function econf, Line 320, Exitcode 1
> ...

 

 :Confused: 

Any more suggestions?

----------

## Varsh

I was getting this constantly for ages too (a couple days in fact), I tried every PHP and Mod_php out there yet I was getting line 338, the way I solved it was to install mysql first, strange as it seems, I then thought "one more try for php", so I installed mod_php and it compiled fine, odd but it worked, try giving that a try, mind you though, MySQL is a 30MB download so it's going to take a LONG time to compile.

----------

## gojuka

Hi Theme. Just for sake of argument, can you post the output of the following command so we can see it?

```
emerge -pv mod_php
```

Mark

----------

## theme

hello excuse me, i've been very busy these days.

This is what i get:

 *Quote:*   

> 
> 
> bash-2.05b# emerge -pv mod_php
> 
> These are the packages that I would merge, in order:
> ...

 

Does this tell you something?

----------

## theme

I know that it may sound incrdible but I emerged mysql and then I was able to emerge without any problem the mod_php module. Therefore, I'm keen to know why i was unable to emerge it? should I put - mysql in the USE variable?

I would like to make a report of my project, ofcourse my desire is that anybody who find the same problems can chek it and resolve them.

----------

## pterjan

(and emerging mysql before doesn't help)

The problem is that when I run manually configure il tells 

```
checking whether the C compiler (gcc  ) is a cross-compiler... no

```

and when I run emerge  get

```
checking whether the C compiler (gcc -march=i586 -O3 -pipe ) is a cross-compiler... yes

```

so I guess something prohibits running the simple test file.

The problem is not with the options because

```
CFLAGS="-march=i586 -O3 -pipe" ./configure
```

produces

```
checking whether the C compiler (gcc -march=i586 -O3 -pipe ) is a cross-compiler... no
```

----------

## pterjan

OK I found a solution in https://forums.gentoo.org/viewtopic.php?t=64713

Trying right now

----------

## pterjan

 *pterjan wrote:*   

> OK I found a solution in https://forums.gentoo.org/viewtopic.php?t=64713
> 
> Trying right now

 

OK emerge -C libwww and emerge libwww fixed the problem, gcc is not anymore considered as a cross-compiler

----------

## norvalk

thx, me too had the same problem...

i don't know if this qualifies as a bug - but since it seems like a prevalent/recurring "phenomena", should one be nevertheless filled to bugzilla?

----------

## Canuck

After reading this thread I unmerged libwww and mysql and then emerged them again, followed by emerging mod_php.

I have yet to try this setup.  I've seen quite a few posts that indicate there can be problems running php with apache2.  I guess I'll find out.

----------

