# Apache and PHP problems [SOLVED]

## sleepingsun

I install apche2 - working, installed mysql and working install php 5.1.4 and not working ! 

I also add this line on /etc/config.d/apache 2 

 *Quote:*   

> APACHE2_OPTS="-D DEFAULT_VHOST -D SSL -D PHP5"

 

Also maybe i need to merge some files ! 

I do it emerge -pv apache2

 *Quote:*   

> These are the packages that I would merge, in order:
> 
> Calculating dependencies
> 
> emerge: there are no ebuilds to satisfy "apache2".

 

I add apache2 in boot --> rc-update add apache2 default

When i do same with emerge -pv apache

I get this ! 

 *Quote:*   

> [ebuild   R   ] net-www/apache-2.0.55-r1  -apache2 -debug -doc -ldap -mpm-leader -mpm-peruser -mpm-prefork -mpm-threadpool -mpm-worker -no-suexec (-selinux) +ssl -static-modules -threads 0 kB

 

When i type that ebuild command i get error massage !

 *Quote:*   

> bash: [ebuild: command not found

 

I try with diffrent and get same error ! 

 *Quote:*   

> [ebuild  N    ] app-text/htmltidy-5.10.26-r1
> 
> bash: [ebuild: command not found

 

Need help what to do that i have working comand [ebuild R] .....

Please help !!! I'm newbie in this gentoo i try myself but need help !

Friendly 

SleepingSunLast edited by sleepingsun on Sun May 21, 2006 10:42 pm; edited 1 time in total

----------

## lxg

 *sleepingsun wrote:*   

> I install apche2 - working, installed mysql and working install php 5.1.4 and not working ! 
> 
> I also add this line on /etc/config.d/apache 2 
> 
>  *Quote:*   APACHE2_OPTS="-D DEFAULT_VHOST -D SSL -D PHP5" 
> ...

 

There is no package "apache2" because the most recent is version 2 anyway. But some directories and the rc-scrpt are named apache2 for backwards compatibility. (Some still use Apache 1.3.x.)

 *Quote:*   

> When i type that ebuild command i get error massage !
> 
>  *Quote:*   bash: [ebuild: command not found 
> 
> I try with diffrent and get same error ! 
> ...

 

The [ebuild ] part is just for your information and tells you how the package is integrated into your system. rtfm.

When you want to emerge something, type "emerge -pv <package>" to see what would be installed (including dependencies and USE flags). Then "emerge <package>" in order to get it installed.

----------

## sleepingsun

I read handle book print and read again but example when i get this when i type 

emerge -pv apache

and get this massage !

[ebuild R ] net-www/apache-2.0.55-r1 -apache2 -debug -doc -ldap -mpm-leader -mpm-peruser -mpm-prefork -mpm-threadpool -mpm-worker -no-suexec (-selinux) +ssl -static-modules -threads 0 kB

What i need to do ?

----------

## kg

Erm, I'm confused.  What's the problem?

You say that Apache and MySQL are installed and working, but PHP is not working.  

Yet you don't say anything about what PHP is or isn't doing.     :Wink: 

So, does apache start and can you connect to your webserver?  Yes?

How do you know PHP is not working?  What are you doing?  Error messages?

----------

## sleepingsun

Becouse i  test.php  and i need to see some information but i see text of php or give me that i download that and also i installed phpmyadmin and when i type localhost/phpmyadmin i see list of files i try also to type localhost/phpmyadmin/index.php i see edit index php not menu and option like phpmyadmin show ! I worked in suse with this and i know how is look phpmyadmin and test.php ! 

I see it list of files or if i made index,php i sow it like text edited file not run !

Also i do it this ! 

/etc/conf.d/apache

 *Quote:*   

> APACHE2_OPTS="-D DEFAULT_VHOST -D PHP5"

 

But somehow php is not work with apache !

----------

## kg

Ok.

 *Quote:*   

> emerge -pv apache
> 
> and get this massage !
> 
> [ebuild R ] net-www/apache-2.0.55-r1 -apache2 -debug -doc -ldap -mpm-leader -mpm-peruser -mpm-prefork -mpm-threadpool -mpm-worker -no-suexec (-selinux) +ssl -static-modules -threads 0 kB
> ...

 

Nothing.  :Smile:    The emerge -pv apache shows what would happen if you were to emerge apache again (-p = pretend).

It simply shows you that apache-2.0.55-r1 is installed with all those use flags.  The R in the [ebuild R ] means it will 

simply rebuild apache if you emerge apache again.  (as opposed to U for upgrade or N if it is new).

Now, on to the PHP issue.  If you do 

```
emerge -pv dev-lang/php
```

 do you have +apache2 listed in the use flags?

In /etc/apache2/httpd.conf is there a line like:

```
Include /etc/apache2/modules.d/*.conf
```

Also, do you have the file 70_mod_php5.conf in the directory /etc/apache2/modules.d?

----------

## sleepingsun

emerge -pv dev-lang/php

 *Quote:*   

> These are the packages that I would merge, in order:
> 
> Calculating dependencies ...done!
> 
> [ebuild   R   ] dev-lang/php-5.1.4  -adabas -apache -apache2 -bcmath +berkdb -birdstep +bzip2 -calendar -cdb -cgi -cjk +cli +crypt -ctype +curl -curlwrappers -db2 -dbase -dbmaker -debug -discard-path -doc -empress -empress-bcs -esoob +exif -fastbuild -fdftk -filepro -firebird -flatfile -force-cgi-redirect -frontbase -ftp -gd -gd-external +gdbm +gmp -hardenedphp -hash -hyperwave-api -iconv -imap -informix -inifile -interbase -iodbc +ipv6 -java-external -kerberos -ldap -libedit -mcve -memlimit -mhash -ming -msql -mssql +mysql -mysqli +ncurses +nls -oci8 -oci8-instant-client -odbc -pcntl +pcre -pdo -pdo-external -pic -posix -postgres -qdbm +readline -recode +reflection -sapdb -sasl +session -sharedext -sharedmem -simplexml -snmp -soap -sockets -solid +spell +spl -sqlite +ssl -sybase -sybase-ct -sysvipc -threads -tidy -tokenizer +truetype -unicode -vm-goto -vm-switch -wddx +xml -xmlreader -xmlrpc -xmlwriter -xpm -xsl -yaz -zip +zlib 0 kB
> ...

 

I get that !

Yes that line exist !

Include /etc/apache2/modules.d/*.conf

45_mod_dav.conf

41_mod_ssl.default-vhost.conf

41_mod_ssl.default-vhost.conf

70_mod_php5.conf  this mod is not in /etc/apache2/modules.d? ! What to do ?

But its on /etc/apache/modules.d?

70_mod_php5.conf

10_mod_ssl.conf

When i copy paste i get this error when i restart apache !

/etc/init.d/apache2 start

 *Quote:*   

>  * Re-caching dependency info (mtimes differ)...
> 
>  * Re-caching dependency info (mtimes differ)...
> 
>  * Re-caching dependency info (mtimes differ)...
> ...

 

----------

## kg

Looks like your PHP was built without the apache2 use flag.

 *Quote:*   

> Calculating dependencies ...done!
> 
> [ebuild R ] dev-lang/php-5.1.4 -adabas -apache -apache2 -bcmath +berkdb -birdstep +bzip2 ... [etc]

 

You'll need to rebuild PHP with it.  Take a look at the PHP upgrade guide (not because you are upgrading, 

but because it is incredibly thorough on emerging PHP--just ignore the stuff about PHP4   :Wink:  ).

http://www.gentoo.org/proj/en/php/php-upgrading.xml

In particular, you should pay attention to the section "Set the Use Flags".  

As explained there, add a line to /etc/portage/package.use which contains your PHP use flags.  

(Alter the ones in the guide as you see fit;you must have apache2 to get this to work--I'd just 

use the ones listed...)

Then emerge dev-lang/php and you should have the 70_mod_php5.conf in your /etc/apache2/modules.d directory.

(And a suitable module for apache2 to use.)  Stop/start apache2 and see what happens....

----------

## sleepingsun

Thank you ! 

Work that is just need to do this ! 

 *Quote:*   

> USE="cli apache2" emerge '=dev-lang/php-5*'

 

Thank you so much ! 

Friendly

SleepingSun

----------

## lxg

I'd suggest you don't set the use flags on command line as in the above example, but rather setting them in file just designed for custom USE flags. Works like this:

```
echo "dev-lang/php dba ftp gd iconv ldap session xml xmlrpc pcre truetype" >> /etc/portage/package.use
```

(I also added some USE flags I found useful if not to say mandatory for a properly working PHP.)

----------

## kg

 :Cool:  Great.  Glad it is working now.

I'd have to agree with lx0.  You're probably better off adding those USE flags to the file /etc/portage/package.use

(even if you just want to add the cli and apache2 flags).

In the long run, it will make things easier as you will always build the package with the same flags

and you'll only have to go to one place to see what you used rather than emerge -pv every package....

----------

## sleepingsun

Thanks for advice its worked thanks friends !

----------

