apache and php common tips and problems

When I deploy php application on apache, some problem come out, and solved. Here's the tips and problems solved.


0.How could I deploy an apache server armed with php, mysql, perl, and phpMyAdmin on the fly?
You need a package bundled with all these tools,  xampp shall meet you needs, you can download it here
(windows/mac/linux/Solaris supported):
http://sourceforge.net/projects/xampp/files/

1. I meet the php page error:

strftime() [function.strftime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier.

You can
explicitly set it in any of the following ways:

a.The date.timezone setting in php.ini
b.At runtime with date_default_timezone_set()
c. Setting the TZ variable in Apache's environment (in
httpd.conf, .htaccess, or a few other ways)

solve a: uncomment the date.timezone line, and set the timezone to your desired,
such as 'Europe/Berlin' or 'Asia/Shanghai'

   [Date]
   ; Defines the default timezone used by the date functions
   date.timezone = Asia/Shanghai

2. apache/logs/error.log shows "Bad file descriptor: don't know how to spawn child process" like :
[Mon Jan 25 16:59:59 2010] [error] [client 127.0.0.1] D:/XXXServer/trend/coretech/abc.html is not executable; ensure interpreted scripts have "#!" first line
[Mon Jan 25 16:59:59 2010] [error] [client 127.0.0.1] (9)Bad file descriptor: don't know how to spawn child process: D:/XXXServer/trend/coretech/abc.html
[Mon Jan 25 18:17:49 2010] [error] [client 127.0.0.1] (9)Bad file descriptor: don't know how to spawn child process: D:/mywebapp/img/left-content-header.css, referer: http://127.0.0.1/mywebapp/navigation.php

solution: some version of Apache/2.2.14 (Win32) doesn't process read only files properly, 
you can solve it by "AddHandler  default-handler .jpg .gif .js .txt .bat .html .css" to your Directory section:

<Directory />
    AddHandler default-handler .jpg .gif .js .txt .bat .html .css
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值