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
Ïà¹ØÎĵµ£º
<?php
class Tree
{
// public $data=array();//ËùÓнڵãÖµ
// public $cateArray=array();//ËùÓи¸½Úµã
function Tree()
{
&n ......
ÒòΪÎÒÔÚ¹úÍâΪ¶à£¬ÔÚ¹úÄÚÓеãÊ£¬Ò²²»ÖªµÀÉÏÊ²Ã´Íø±È½ÏºÃ¡£Ïë°Ñ×Ô¼ºµÄ·¿×Ó×â³öÈ¥£¬Ëæ±ãÕÒÁËÒ»¸öÊ²Ã´Íø·¢²¼ÁËһϣ¬Á½Ìì¾Í×â³öÈ¥ÁË£»¿ÉÏëÕÒphper£¬²»Ôõô³É¹¦¡£Ç°ÄêÊǰïÅóÓÑÕÒ£¬ÓÃÁ˲»ÉÙÇþµÀ£¬µ«Ã»ÉÏcsdn£¬Ã»³É¡£ÏÖÔÚΪ×Ô¼º£¬Ï£ÍûÄÜÕÒµ½ºÏÊʵġ£µ±È»ÕÐÈ˸ú×â·¿²»Ò»Ñù£¬ÄÑÒ»µã²»Ææ¹Ö¡£phpers°¡£¬¿ìÀ´°É... ......
½ñÌì¸ãÁËÒ»ÏÂÎ磬ÔÚµçÄÔÉϴÁËAPMƽ̨
ϵͳ:Windows7 Professional EN
Apache2.2.9:http://archive.apache.org/dist/httpd/binaries/win32/apache_2.2.9-win32-x86-openssl-0.9.8h-r2.msi
PHP5.3.1:http://windows.php.net/downloads/releases/php-5.3.1-Win32-VC6-x86.zip
MySQL5.1.42:http://ftp.iij.ad.jp/pub/db/ ......
$_POST ±äÁ¿ÓÃÓÚÊÕ¼¯À´×Ô method="post" µÄ±íµ¥ÖеÄÖµ¡£
$_POST ±äÁ¿
$_POST ±äÁ¿ÊÇÒ»¸öÊý×飬ÄÚÈÝÊÇÓÉ HTTP POST ·½·¨·¢Ë͵ıäÁ¿Ãû³ÆºÍÖµ¡£
$_POST ±äÁ¿ÓÃÓÚÊÕ¼¯À´×Ô method="post" µÄ±íµ¥ÖеÄÖµ¡£´Ó´øÓÐ POST ·½·¨µÄ±íµ¥·¢Ë͵ÄÐÅÏ¢£¬¶ÔÈκÎÈ˶¼ÊDz»¿É¼ûµÄ£¨²»»áÏÔʾÔÚä¯ÀÀÆ÷µÄµØÖ·À¸£©£¬²¢ÇÒ¶Ô·¢ËÍÐÅÏ¢µÄÁ¿Ò²Ã»ÓÐÏÞÖ ......
×î½üÎÒÕæÊÇÍ·´óÒÓ£¬ÎҵIJ©¿ÍÀï¾ÓȻһҹ¼ä±ä³ÉÁËphpºÍaspµÄ¶·Õù³¡£¬ÉõÖÁ±ä³ÉÁËwindowsºÍlinuxµÄ¶·Õù³¡¡£ÕæÊÇÒâÏë²»µ½µÄ¡£
ÎÒ±¾À´ÎÞÒâÌôÆðwindowsºÍlinuxÖ®¼äµÄÕù¶Ë£¬¶øÇÒÒ²·Ç³£²»ÏëÈ¥ÌôÕâÖÖÕù¶Ë¡£
»°Ëµ£¬ÆäʵÎÒ±¾Éí¶Ôlinux²Ù×÷ϵͳÊÇûÓÐʲô»µÓ¡ÏóµÄ£¬ËäÈ»×Ô¼ºµÄµçÄÔÉÏûÓÐ×°¹ýlinux£¬µ«ÊÇÔÚͬѧµÄµçÄÔÉÏÓùý£¬¾õµÃËüͦºÃ ......