`

Php Development Tips

阅读更多

(1)解决php.ini文件放置路径问题方法:

  在Unix上,php.ini文件缺省放在/usr/local/lib上面,因为缺省的存放路径是<install-path> /lib,但是可以在编译的时候使用--with-config-file-path参数来修改php.ini的存放位置,例如你可以使用--with- config-file-path=/etc把它存放到/etc下面,然后可以从源码包中拷贝php.ini-dist到/etc/php.ini并修改使之满足需要。

 

(2)window平台上apache/php错误:

 

(20024)The given path is misformatted or contained invalid characters: Cannot map POST /prorC?%20echo($submit_form_action_path)%20?%3E HTTP/1.1 to file, referer: http://...../index.php?a=platform_user

从上次更新了php 5.3之后,这个问题困扰了我好几天。在网上查资料,基本上都是无果而终。今天运气好点,将同样配置的机器(window xp sp3/apache 2.2.17/php 5.3.35)升级到了5.3后,发现这个机器可以正常运行。开始怀疑是apache的问题,就用winmerge比较两台机器的httpd.conf文件,发现文件内容都是一模一样的,除了端口不同。自己怀疑真的是否遇到了所谓的“人品问题”,心里不干,又比较了一下php.ini文件,最后发现两个文件在第226行中有一个

; Default Value: On
; Development Value: Off
; Production Value: Off
; http://php.net/short-open-tag
short_open_tag = Off

  最后将这里改成

 

; Default Value: On
; Development Value: Off
; Production Value: Off
; http://php.net/short-open-tag
short_open_tag = On

 问题解决,自己php的业余爱好者,遇到这样的问题只能是抓虾了,希望对还在抓虾的童鞋有所帮助。最后鄙视下win下 的php 。推荐大家还是在linux下折腾吧

(2)EOT定界符使用中出现的错误:
PHP Parse error: syntax error, unexpected T_SL in
Parse error: syntax error, unexpected $end in

echo <<< EOT
<table width=80% border="2" cellpadding="3" cellspacing="0" bordercolor="#808080">
<tr bgcolor="#84A9E1">
<td align="center">ClassID</td>
<td align="center">stuno</td>
<td align="center">学生姓名</td>
<td align="center">家长姓名</td>
<td align="center">家长手机号</td>
</tr>
EOT; 
 开始的"<<<EOT"定界符后面不能有tab或空格,可以加回车。
 结束的"EOT;"必须要顶在这一行的最前面。中间不能用空格或tab等字符。(php有一个折磨人的问题。)

(3)php.ini中date.timezone的设置
php5的时区设置默认为UTC,为了将其改成北京时间,可以将其设置为
date.timezone =Asia/Chongqing
或者
date.timezone =Asia/Shanghai
(4)php日志输出在windows cmd中是乱码,解决办法修改cmd编码方式:
由于在telnet到服务器的时候,某些服务器是utf-8编码的,但是Windows cmd默认的是系统编码,所以需要修改下,使用chcp 命令:
Java代码  收藏代码

   1. chcp 65001  就是换成UTF-8代码页  
   2. chcp 936 可以换回默认的GBK  
   3. chcp 437 是美国英语   
 



分享到:
评论

相关推荐

    Getting Started with OpenCart Module Development

    It has become widely popular because of its support for custom extensions and module development. This book helps you understand how to use the features available in OpenCart using step-by-step ...

    PHP in a Nutshell

    PHP in a Nutshell is a complete reference to the core ...Whether you're just getting started or have years of experience in PHP development, PHP in a Nutshell is a valuable addition to your desk library.

    PHP Cookbook, 2nd edition

    There are tips in here for everyday PHP programmers as well as for people coming to PHP with experience in another language. PHP, in source code and binary forms, is available for download for free ...

    《5 Practical React Projects》- 2017 英文原版

    Along the way, you’ll pick up lots of useful development tips. It contains: How to Create a Reddit Clone Using React and Firebase by Nirmalya Ghosh Build a CRUD App Using React, Redux and ...

    《5 Practical React Projects》2017 英文原版 Kindle - mobi格式

    Along the way, you’ll pick up lots of useful development tips. It contains: How to Create a Reddit Clone Using React and Firebase by Nirmalya Ghosh Build a CRUD App Using React, Redux and ...

    plug-In PHP- 100 Power Solutions

    Written by PHP expert with many years of experience developing websites in PHP and writing about PHP development, this invaluable resource draws on the author’s personal toolkit of solutions built up...

    《Better WordPress Development》- 2017 PDF 英文原版

    10 Easy WordPress Security Tips by Craig Buckler Understanding WordPress Pages and the Pages API by Jérémy Heleine 5 Time-Saving Uses for WP-CLI Automation by Jeff Smith This book is suitable for ...

    Flex Solutions Essential Techniques For Flex 2 And 3

    Marco takes you through the workings of the example step by step, and then presents some expert's tips, which will take your understanding further, and give you unique insights into Flex development....

    Kindle Computer Science other.rar

    Database\Oracle Internals - Tips Tricks and Techniques for DBAs.mobi Database\OReilly High Performance MySQL.mobi Database\OReilly SQL and Relational Theory 2nd.mobi Database\OReilly SQL Cookbook.mobi...

    iPhone Games Projects

    It's loaded with practical tips for efficient development and creating compelling, totally addictive gaming experiences. And it's not all talk! It's packed with code that you can download and use to ...

    WordPress Theme Design: A complete guide to creating professional WordPress themes

    From development tools and setting up your WordPress sandbox, through design tips and suggestions, to setting up your theme's template structure, coding markup, testing and debugging, to taking it ...

    《Back-end Performance》2017 英文原版 PDF格式

    Because every second—every kilobyte—matters Performance simply matters. Technology may allow us to “go ... You’ll need to be familiar with server-side development in order to follow the discussion.

    getting started with Flex 3

    Discover how easy RIA development can be with this one-of-a-kind handbook from the Adobe Developer Library. Several clear, step-by-step mini-tutorials teach you about web services, event handling, ...

    Sams Teach Yourself Microsoft Expression Web 3 in 24 Hours.pdf

    I’ve also included new and improved tutorials, tricks and tips to make you a better and more effective designer, and an entirely new chapter focus- ing on the new SuperPreview application included ...

    UE(官方下载)

    This power tip provides an explanation as well as some tips to get the most out of temp files. Backup and Restore Settings One of the staples of UltraEdit (and UEStudio) is its highly configurable ...

    Digging into WordPress.pdf

    9.3.1 Monitoring and Fixing Errors ...............................350 9.3.2 Alex King’s 404 Notifier Plugin .....................................................351 9.3.3 Broken Link Checker Plugin ....

Global site tag (gtag.js) - Google Analytics