首页 > linux > thttpd+php 不加载php.ini 问题

thttpd+php 不加载php.ini 问题

2010年10月26日 eric 发表评论 阅读评论

昨天安装了thttpd+php,关闭php报错机制,于是修改了php.ini,重启了thttpd,没有生效,然后看phpinfo(),Loaded Configuration File 项是 (none),然后编译加上参数 –with-config-file-path= 指定一个位置,重新编译完thttpd 和 php后,启动 thttpd 依然是这样,后来看PHP 官方顿时明白了,php作为thttpd的模块需要修创建环境变量,官方如下:
php.ini 的搜索路径如下(按顺序):
* SAPI 模块所指定的位置(Apache 2 中的 PHPIniDir 指令,CGI 和 CLI 中的 -c 命令行选项,NSAPI 中的 php_ini 参数,THTTPD 中的 PHP_INI_PATH 环境变量
*HKEY_LOCAL_MACHINE\SOFTWARE\PHP\IniFilePath(Windows 注册表位置)
*PHPRC 环境变量
*当前工作目录(对于 CLI)
*web 服务器目录(对于 SAPI 模块)或 PHP 所在目录(Windows 下其它情况)
*Windows 目录(C:\windows 或 C:\winnt),或 –with-config-file-path 编译时选项指定的位置
修改后,居然还是不行·弄来弄去是因为 thttpd 的安全 chroot的路径问题·我没有用到 chroot 所以直接修改配置文件把 chroot 改为 nochroot.

归纳:
想让 thttpd + php支持 php.ini 必须这两步

1.增加环境变量

thttpd $> PHP_INI_PATH=/usr/local/php/etc
thttpd $> export PHP_INI_PATH

2.修改配置文件

thttpd $> vim /usr/local/thttpd/etc/thttpd.conf
port=80
user=www
nochroot
host=0.0.0.0
logfile=/usr/local/thttpd/logs/thttpd.log
pidfile=/usr/local/thttpd/logs/thttpd.pid
throttles=/usr/local/thttpd/etc/throttle.conf
urlpat=*.txt|*.mp3
charset=utf-8
dir=/var/www
cgipat=/usr/local/thttpd/www/cgi-bin/*

我现在觉得可以把thttpd做为下载站来用,限速和防盗链的功能都不错,限速的功能在 nginx之上·

这里千万别有些不明真相的人拍砖,nginx限速功能还不是那么强大·不能针对目录,如果针对某个目录限速需要创建虚拟主机。

本人也是nginx的粉丝·当然thttpd在并发上,性能上还敢不上nginx。 PS:最后一句是我跟人感觉,没有亲自实验说出的话~

转载请注明:文章转载自:Eric's linux and nginx! (http://www.nginxs.com)
本文地址:http://www.nginxs.com/linux/285.html

分类: linux 标签: , ,
  1. 2018年6月23日17:12 | #1

    wh0cd547 [url=http://proscar.us.com/]BUY PROSCAR[/url] [url=http://buytenormin.us.com/]tenormin mastercard[/url] [url=http://buyprovera.us.com/]Buy Provera[/url] [url=http://tadalis.us.com/]as explained here[/url] [url=http://buyvermox.us.com/]generic vermox[/url] [url=http://buyatarax.us.com/]cheap atarax[/url] [url=http://buylipitor.us.com/]more help[/url] [url=http://buyhydrochlorothiazide.us.com/]full report[/url] [url=http://buyviagra.us.org/]viagra tablets[/url] [url=http://amoxicillin.us.com/]amoxicillin[/url] [url=http://abilify.us.org/]read more here[/url]

  2. 2018年6月23日17:21 | #2

    Most actors invest their time and efforts poorly.

  3. 2018年6月23日17:41 | #3
  4. 2018年6月24日02:31 | #4

    wh0cd94895 order suhagra

  5. 2018年6月24日05:19 | #5

    Head turns enable the eyes to comment on a scenario.

  6. 2018年6月24日07:36 | #6

    wh0cd189243 cialis otc

  7. 2018年6月24日10:30 | #7

    wh0cd41541 [url=http://serpina.us.com/]serpina[/url] [url=http://sildenafil.us.org/]CHEAP SILDENAFIL[/url] [url=http://buynexium.us.com/]buy nexium[/url] [url=http://neurontin.us.com/]medication neurontin[/url] [url=http://lasix.us.org/]lasix[/url] [url=http://atenolol2018.us.com/]atenolol 50mg[/url] [url=http://doxycycline.us.org/]order doxycycline[/url] [url=http://proscar.us.com/]Proscar At Lowest Prices[/url] [url=http://antabuse.us.org/]antabuse online[/url] [url=http://amoxicillin2018.us.com/]Amoxicillin Price[/url]

  8. MichaelNah
    2018年6月24日10:58 | #8

    Is there a defence that some videos that I must downloaded will play one’s part with the screen locked while others wishes not? I fool a YouTube Red price and can usually listen to videos I receive downloaded on my phone with the silver screen locked to save on battery. Though, I have noticed that there are sure videos that I obtain downloaded that cours bitcoins last will and testament break playing as pronto as I pursue the screen. On crown of that, the video see fit set forsake to the creation as if I hadn’t been watching it at all. Some other communication that may be impressive to this question is that the videos in theme fall from the unmodified framer as others that do come up with as intended. Multiple channels do the anyhow thing. I had started to think that certain channels were not allowed to operate this avenue, but now that I am having the nonetheless problems with channels I know incorporate and at to assignment,

  9. JasonRessy
    2018年6月24日12:21 | #9

    require some problems with the currency switcher plugin. By inaction, USD is in use. I’ve added some products with a price of ‘100’, the quel est le cours du bitcoin shop page showed ‘$100’. Then I changed the currency to EUR. The one meaning: The output milieu now shows the deliberate USD expenditure ($106,83) but it should show the EUR consequence (€100).

  10. Charlespub
    2018年6月24日12:21 | #10

    ost Contemporary altoghter under!!!

    It is on the computer cours bitcoin cours du bitcoin euros but will not unenclosed!

    So will be enduring to reinstall again! But appears I resolve not be accomplished to use plugins at all. Everytime I test it crashes! I partake of under no circumstances had these problems with earlier versions and useing XP. I be subjected to dog-tired two weeks trying to fetch this to hasten well and I take attempt deadlines in a week.

  11. KevinQuers
    2018年6月24日12:32 | #11

    Congratulations, you sire reached 4.000 hours of support and 1,000 subscriptions in the pattern 12 months! Your gutter is currently beneath le cours du bitcoin: partenaires critique after the terms of the YouTube Partner Program and in behalf of confirming that your Community guidelines are appropriate. We usually email the purposefulness within a week.

  12. EmersonRob
    2018年6月24日14:20 | #12

    A forum is a scrutiny board where users all with the unchanged scrutiny generate topics and press conversations upon anything akin to that area of study or niche.

    A sexual network is a website or app where you can bump into rendezvous with unexplored people and keep company with [url=https://storeboard.com/blogs/cryptocurrency/why-is-bitcoin-maybe-the-best-digital-currency-to-acquire/906943]cours du bitcoin bourse[/url] your friends because of surreptitiously messaging, as opulently as sharing pictures and videos in search your friends to survive help (and evil verse).

  13. 2018年6月24日17:25 | #13

    Nicely rounded folks normally make good actors.

  14. 2018年6月24日18:51 | #14

    Head turns allow the eyes to comment on a situation.

  15. 2018年6月24日21:07 | #15

    What Do Talent Brokers Look For In Actors?

  16. JasonRessy
    2018年6月24日21:21 | #16

    bring into the world some problems with the currency switcher plugin. About default, USD is in use. I’ve added some products with a toll of ‘100’, the quel est le cours du bitcoin shop messenger showed ‘$100’. Then I changed the currency to EUR. The only effect: The offshoot locate once in a while shows the fit USD price ($106,83) but it should put on the EUR expenditure (€100).

  17. 2018年6月24日21:39 | #17

    Head turns enable the eyes to touch upon a state of affairs.

  18. 2018年6月24日23:29 | #18

    Head turns enable the eyes to touch upon a scenario.

  19. 2018年6月25日03:09 | #19

    Nicely rounded individuals usually make good actors.

  20. 2018年6月25日08:53 | #20

    Head turns allow the eyes to comment on a scenario.

  21. 2018年6月25日10:05 | #21

    Most actors make investments their time and efforts poorly.

  22. 2018年6月25日12:44 | #22

    Most actors make investments their time and efforts poorly.

  23. 2018年7月5日04:13 | #23

    Helpful information. Fortunate me I discovered your web
    site accidentally, and I am surprised why this coincidence did not took place earlier!

    I bookmarked it.

  24. 2018年7月6日02:27 | #24

    Why YouTube movies are shared everywhere? I think one motive is that these are easy to get embed code and paste that script anyplace you wish for.

  25. 2018年7月14日22:27 | #25

    Find out what different services they could present.

  26. 2018年7月15日20:07 | #26

    Everyone knows how carpets appeal to grime so much.

评论分页
1 ... 6 7 8 285
订阅评论
3+4= (必填)