PHPRC问题

80 篇文章 0 订阅

I'm using apache2 on OSX, by default the php.ini location is:

/private/etc/php.ini

I need to change it to this...

/Library/FileMaker Server/Web Publishing/publishing-engine/php/lion/lib/php.ini

Any help?

1.Use PHPIniDir directive in apache config file after LoadModule :

example:

LoadModule php5_module /path/to/php5_module

PHPIniDir path/to/php.ini


2.Or set the PHPRC environment variable:

example:

export PHPRC=path/to/php.ini


apache+modfcgi配置PHPRC自定义php.ini路径

下面是apache+mod_fcgid实现PHPRC自定义php.ini路径

linux版本是CentOS Linux release 6.0,apache和mod_fcgid都是yum安装。

修改apache配置文件

添加:

?
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
<VirtualHost *:80>
     ServerAdmin webmaster@dummy-host.example.com
     DocumentRoot /var/www/html
     ServerName 666.5keke.com
     ErrorLog logs/cacti-error_log
     CustomLog logs/cacti-access_log common
     <IfModule mod_fcgid.c>
         ScriptAlias /fcgi-bin/ /home/phpcgi/bin/
         <directory /home/phpcgi/bin/>
             AllowOverride None
             Order allow,deny
             Allow from all
         </directory>
         <Location /fcgi-bin/>
             SetHandler fcgid-script
             Options +ExecCGI
         </Location>
         AddHandler php-fastcgi .php
         Action php-fastcgi /fcgi-bin/php-starter
     </IfModule>
</VirtualHost>

添加php-starter脚本

?
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
vi /home/phpcgi/bin/php-starter
 
#!/bin/sh
umask 022
PHPRC="/home/phpcgi/etc"
 
export PHPRC
PHP_FCGI_CHILDREN=0
export PHP_FCGI_CHILDREN
PHP_FCGI_MAX_REQUESTS=5000
export PHP_FCGI_MAX_REQUESTS
exec /usr/bin/php-cgi -d session.save_path=/home/phpcgi/temp -d open_basedir="/home/phpcgi/temp" -d upload_tmp_dir="/home/phpcgi/temp" -d sendmail_path="/usr/sbin/sendmail -f 5keke -t -i "
 
 
#session.save_path 是保存session的路径
#open_basedir      可将用户访问文件的活动范围限制在指定的区域
#upload_tmp_dir    默认上传临时目录
#sendmail_path     调用sendmail程序的路径

3.In my / folder (above /htdocs) I created an .htaccess file with the following content:

Code:
  
  
SetEnv TZ America/Indianapolis SetEnv ERRLOGFILE /home/users/web/bEXAMPLE/pow.EXAMPLE/phpsessions/cgi_error_log.txt SetEnv TMPDIR /home/users/web/bEXAMPLE/pow.EXAMPLE/phpsessions SetEnv PHPSESSDIR /home/users/web/bEXAMPLE/pow.EXAMPLE/phpsessions SetEnv PHPRC /home/users/web/bEXAMPLE/pow.EXAMPLE/
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

anssummer

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值