From owner-freebsd-questions@FreeBSD.ORG Wed Jan 7 08:27:41 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2892C106564A for ; Wed, 7 Jan 2009 08:27:41 +0000 (UTC) (envelope-from freebsd-questions@pp.dyndns.biz) Received: from proxy1.bredband.net (proxy1.bredband.net [195.54.101.71]) by mx1.freebsd.org (Postfix) with ESMTP id D4BE48FC17 for ; Wed, 7 Jan 2009 08:27:40 +0000 (UTC) (envelope-from freebsd-questions@pp.dyndns.biz) Received: from ironport.bredband.com (195.54.101.120) by proxy1.bredband.net (7.3.127) id 494BF21C00491339 for freebsd-questions@freebsd.org; Wed, 7 Jan 2009 09:27:39 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiM2AKz1Y0lV4jp1PGdsb2JhbAAwgTySEgEBAQE1unKFdQ Received: from c-753ae255.107-1-64736c10.cust.bredbandsbolaget.se (HELO gatekeeper.pp.dyndns.biz) ([85.226.58.117]) by ironport1.bredband.com with ESMTP; 07 Jan 2009 09:27:39 +0100 Received: from [192.168.69.67] (phobos [192.168.69.67]) by gatekeeper.pp.dyndns.biz (8.14.2/8.14.2) with ESMTP id n078RbLb002720 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 7 Jan 2009 09:27:38 +0100 (CET) (envelope-from freebsd-questions@pp.dyndns.biz) Message-ID: <49646779.5000005@pp.dyndns.biz> Date: Wed, 07 Jan 2009 09:27:37 +0100 From: =?ISO-8859-1?Q?Morgan_Wesstr=F6m?= User-Agent: Thunderbird 2.0.0.19 (X11/20090102) MIME-Version: 1.0 To: FreeBSD Questions References: <4962EB85.7000700@pp.dyndns.biz> <27ade5280901060609t2e768f14p32639b7ed2ac7a9c@mail.gmail.com> In-Reply-To: <27ade5280901060609t2e768f14p32639b7ed2ac7a9c@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Subject: Re: PHP Apache module no longer loads /usr/local/etc/php.ini X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jan 2009 08:27:41 -0000 APseudoUtopia wrote: > On Tue, Jan 6, 2009 at 12:26 AM, Morgan Wesström > wrote: >> Hi. >> >> I have two almost identical FreeBSD servers with FreeBSD 7.0, Apache >> 2.2.11 and PHP 5.2.8. After a restart of Apache four days ago, the PHP >> module on one of those servers no longer loads /usr/local/etc/php.ini >> and I can't for my world figure out what's preventing it. My workaround >> right now is to move php.ini to / where it is loaded properly. >> >> phpinfo on non-working server: >> http://pp.dyndns.biz/phpinfo.php >> >> phpinfo on working server: >> http://prefectftp.no-ip.com/phpinfo.php >> >> According to php.net the default location for php.ini is /usr/local/lib >> and to change that you have to compile PHP with >> --with-config-file-path=/some/path but I can't see that this is done on >> FreeBSD. Still /usr/local/etc is listed in phpinfo's "Configuration File >> (php.ini) Path". What mechanism does FreeBSD use to alter the default >> location of the ini file? Can I somehow have interfered with that mechanism? >> >> The following things DO work though: >> - Setting PHPRC to /usr/local/etc (as described in php.ini) and >> restarting Apache loads /usr/local/etc/php.ini correctly. >> - CLI version works correctly regardless of PHPRC: >> # php -i | grep php.ini >> Configuration File (php.ini) Path => /usr/local/etc >> Loaded Configuration File => /usr/local/etc/php.ini >> >> No errors are listed in any log-file and I've been banging my head >> against the wall for four days now trying to solve this... Any help >> would be appreciated to figure out what stupid mistake I've made. :-) >> >> Regards >> Morgan >> > > Notice: > Configuration File (php.ini) Path /usr/local/etc > Loaded Configuration File /php.ini > > So it _IS_ looking in /usr/local/etc/ for a php.ini file, it just can't find it. > Move the file back to /usr/local/etc/, then make sure the permissions > are correct (so the www-data user can read) on both the php.ini file > and the directories above it. > I forgot to respond to the list on this. php.ini was present all the time in /usr/local/etc and with the right permissions. There seemed however to be some weird inconsistencies in my filesystem after one of the disks in my gmirror RAID1 failed earlier that day and I had to rebuild it. Creating a new copy of php.ini in /usr/local/etc once again made the php module able to pick it up. I have now fsck:ed all filesystems and I hope they're alright again. Just out of curiosity: how does the FreeBSD port of lang/php5 find /usr/local/etc/php.ini without being compiled with --with-config-file-path ? /Morgan