php-学习笔记(整理)

来源:互联网 发布:python中延时函数 编辑:程序博客网 时间:2024/06/10 06:14

1、启动报错

修改

#DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs"
DocumentRoot "/Users/wangwei/Documents/php/myphp”

报错:

estarting Apache Web Server...
Exit code: 8
Stdout:
apache config test fails, aborting
apache config test fails, aborting
Stderr:
AH00526: Syntax error on line 230 of /Applications/XAMPP/xamppfiles/etc/httpd.conf:
DocumentRoot must be a directory
AH00526: Syntax error on line 230 of /Applications/XAMPP/xamppfiles/etc/httpd.conf:
DocumentRoot must be a directory

是因为引号输入错误导致,修改为DocumentRoot "/Users/wangwei/Documents/php/myphp"就ok了


2、关于中文乱码,

我用win7+eclipse做为IDE工具,修改字符编码的方法为window->preferences->General->Workspace->Text file encoding选other,选中utf-8


3、调用同一类中的某个类的方法,通过$this->来实现。

function a1(){

}

function a2(){

  $this->a1();

}

0 0
原创粉丝点击