View previous topic :: View next topic |
Author |
Message |
tuuletin n00b

Joined: 05 Feb 2006 Posts: 22
|
Posted: Sun Feb 05, 2006 12:59 pm Post subject: Apache ja php *ratkaistu* |
|
|
Kuinka apache:en conffataan php?Olen asentanut apachen ja php-modin.(emerge mod_php)
Modules.d näyttää tältä:
localhost modules.d #: dir
40_mod_ssl.conf 41_mod_ssl.default-vhost.conf 45_mod_dav.conf 46_mod_ldap.conf 70_mod_php.conf
Jos yritän avata *.php-tiedoston, nettiselain pyytää tallentaman tiedoston.
Last edited by tuuletin on Sun May 28, 2006 9:45 am; edited 1 time in total |
|
Back to top |
|
 |
Elekrep Tux's lil' helper

Joined: 18 Sep 2004 Posts: 108 Location: Finland
|
Posted: Sun Feb 05, 2006 1:42 pm Post subject: |
|
|
http://gentoo-wiki.com/Index:HOWTO#Apache_Related
Kannattaa lukea joku noista.
Mutta ainakin /etc/conf.d/apache2 een pitää lisätä optio APACHE2_OPTS="-D PHP4", tietenkin pitäen ne muutkin mitä tarvitset. |
|
Back to top |
|
 |
tuuletin n00b

Joined: 05 Feb 2006 Posts: 22
|
Posted: Sun Feb 05, 2006 1:59 pm Post subject: |
|
|
Edit: Php_mod:in asennus meni näin:
* The INI file for this build is /etc/php/cli-php4/php.ini
* If you have both freetds and mssql in your USE flags, parts of PHP
* may not behave correctly, or may give strange warnings. You have
* been warned! It's recommended that you pick ONE of them. For sybase
* support, chose 'freetds'. For mssql support choose 'mssql'.
/usr/lib/portage/bin/ebuild.sh: line 192: 24316 Segmentation fault /usr/lib/portage/bin/portageq 'has_version' "${ROOT}" "$1"
* If you have additional third party PHP extensions (such as
* dev-php/eaccelerator) you may need to recompile them now.
* Please be aware that CURL can allow the bypass of open_basedir restrictions.
* This is a CLI only build.
* You cannot use it on a webserver.
ja apachen käynnistäminen heittää näin:
* Caching service dependencies ...
* Service 'firehol' already provided by 'firewall'!;
* Not adding service 'firestarter'...
* Service 'metalog' already provided by 'logger'!;
* Not adding service 'sysklogd'... [ ok ]
* Apache2 has detected a syntax error in your configuration files:
Syntax error on line 1097 of /etc/apache2/httpd.conf:
Invalid command 'APACHE2_OPTS="-D', perhaps mis-spelled or defined by a module not included in the server configuration |
|
Back to top |
|
 |
Elekrep Tux's lil' helper

Joined: 18 Sep 2004 Posts: 108 Location: Finland
|
Posted: Sun Feb 05, 2006 8:57 pm Post subject: |
|
|
APACHE2_OPTS="-D DEFAULT_VHOST -D PHP4 -D SSL -D DOC"
tuossa on mun versio, mutta tietenkään voi konekohtaisesti sanoa että toi toimisi. |
|
Back to top |
|
 |
Flammie Retired Dev


Joined: 02 Jun 2003 Posts: 633 Location: Dublin, Ireland
|
Posted: Mon Feb 06, 2006 1:41 am Post subject: |
|
|
Hmm... jollen ihan väärin ole käsittänyt, dev-lang/php korvaa vanhat php_mod- ja php-paketit? Mutta toki molemmat toimivat.
Quote: | * Apache2 has detected a syntax error in your configuration files:
Syntax error on line 1097 of /etc/apache2/httpd.conf:
Invalid command 'APACHE2_OPTS="-D', perhaps mis-spelled or defined by a module not included in the server configuration |
Virheilmoituksesta päätellen olet myös kirjoittanut tiedostoon /etc/apache/httpd.conf asetuksia, jotka kuuluvat tiedostoon /etc/conf.d/apache2.
Quote: | Php_mod:in asennus meni näin:
* The INI file for this build is /etc/php/cli-php4/php.ini
* This is a CLI only build.
* You cannot use it on a webserver. |
Luulisin että tässä ei kyse ole php_modista vaan nimenomaan dev-php/php:stä, joka ei apachelle kelpaa.
Quote: | * Caching service dependencies ...
* Service 'firehol' already provided by 'firewall'!;
* Not adding service 'firestarter'...
* Service 'metalog' already provided by 'logger'!;
* Not adding service 'sysklogd'... [ ok ] |
Lisäksi järjestelmääsi on ilmeisesti asennettu sekaisin useita järjestelmälokeja ja palomuurisovelluksia määrittelemättä mitä niistä käytetään (tai kaikki on määritelty käytettäväksi yhtaikaa).
Quote: | /usr/lib/portage/bin/ebuild.sh: line 192: 24316 Segmentation fault /usr/lib/portage/bin/portageq 'has_version' "${ROOT}" "$1" |
Ja jos järjestelmä on sitä luokkaa epävakaa, että portageq segfaulttailee, en ihmettelisi, vaikka se olisi laajemminkin ihan vaan rikki. |
|
Back to top |
|
 |
Elekrep Tux's lil' helper

Joined: 18 Sep 2004 Posts: 108 Location: Finland
|
Posted: Mon Feb 06, 2006 12:44 pm Post subject: |
|
|
ls /etc/php/*
/etc/php/apache2-php4:
php.ini
/etc/php/cli-php4:
php.ini
Aihetta sivuten. Mitähän varten on ihan erillinen cli-php4 hakemisto? |
|
Back to top |
|
 |
tuuletin n00b

Joined: 05 Feb 2006 Posts: 22
|
Posted: Tue Feb 07, 2006 3:06 pm Post subject: |
|
|
Ei toimi, vaikka tein ohjeiden mukaan, pyytää vain tallentamaan tai avaamaan tiedoston.Mitäs nyt.  |
|
Back to top |
|
 |
Elekrep Tux's lil' helper

Joined: 18 Sep 2004 Posts: 108 Location: Finland
|
Posted: Tue Feb 07, 2006 11:12 pm Post subject: |
|
|
Vaikuttais ettei se servu tajua että on kyseessä php filu.
Ootko varmasti määrittäny sen .php määritteen ? |
|
Back to top |
|
 |
tuuletin n00b

Joined: 05 Feb 2006 Posts: 22
|
Posted: Wed Feb 08, 2006 5:07 pm Post subject: |
|
|
Elekrep wrote: | Vaikuttais ettei se servu tajua että on kyseessä php filu.
Ootko varmasti määrittäny sen .php määritteen ? |
Quote: | APACHE2_OPTS="-D SSL -D PHP4" |
Tuotako tarkoitat? |
|
Back to top |
|
 |
Elekrep Tux's lil' helper

Joined: 18 Sep 2004 Posts: 108 Location: Finland
|
Posted: Wed Feb 08, 2006 11:05 pm Post subject: |
|
|
Tälläinen pitäisi ainakin löytyä
/etc/apache2/modules.d/70_mod_php.conf
jossa:
Code: |
# vim: ft=apache sw=4 ts=4
<IfDefine PHP4>
# Load the module first
<IfModule !sapi_apache2.c>
LoadModule php4_module modules/libphp4.so
</IfModule>
# Set it to handle the files
<IfModule mod_mime.c>
AddType application/x-httpd-php .php
AddType application/x-httpd-php .phtml
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php4
AddType application/x-httpd-php-source .phps
</IfModule>
AddDirectoryIndex index.php index.phtml
</IfDefine>
|
JA sitten tarttee olla tuolla /etc/apache2/httpd.conf :
Code: |
#
# Extra Modules
#
# We Include extra .conf files from /etc/apache2/modules.d
# This is used to load things like PHP and mod_ssl.
#
Include /etc/apache2/modules.d/*.conf
|
että se tajuaa ladata ne moduulit.
Sitte tietty ku oot muuttanu ni "apache2 -k restart" että se lataa ne. |
|
Back to top |
|
 |
tuuletin n00b

Joined: 05 Feb 2006 Posts: 22
|
Posted: Thu Feb 09, 2006 2:14 pm Post subject: |
|
|
Ei auta, kohta loppuu usko.
Edit: Saan ehkä toimimaan, pieni hetki....
Edit2: Ei  |
|
Back to top |
|
 |
Elekrep Tux's lil' helper

Joined: 18 Sep 2004 Posts: 108 Location: Finland
|
Posted: Fri Feb 10, 2006 9:57 pm Post subject: |
|
|
Enpä oikein tiedä sitten =\
Tietty kannattaa käydä konffit läpi vielä rivi riviltä, josko sinne joku ylimäärnen pilkku tms ois jääny. |
|
Back to top |
|
 |
Uhkis n00b

Joined: 01 Jun 2004 Posts: 9
|
Posted: Tue Mar 07, 2006 10:12 am Post subject: |
|
|
Oletko ennen asentanut apache+php-yhdistelmää?
Tiedätkö että sivut avataan osoitteella http://127.0.0.1/tiedostonnimi.php eikä esimerkiksi /var/www/htdocs/tiedostonnimi.php ? |
|
Back to top |
|
 |
tuuletin n00b

Joined: 05 Feb 2006 Posts: 22
|
Posted: Thu Mar 09, 2006 7:52 pm Post subject: |
|
|
Ongelma ratkennut.En tiedä miten.  |
|
Back to top |
|
 |
|