windows下安装php及搭建debug环境
安装apache2.4
官方地址:http://httpd.apache.org/
如果选择2.2官方会编译好,选择2.4,要从其他镜像下载
Files for Microsoft Windows
然后选择ApacheHaus
然后下载v11_x64版本
修改配置httpd.conf
1.修改ServerRoot到安装目录
2.修改DocumentRoot到htdocs
php5.6.14基础安装
官方地址:http://php.net/
到官方地址下载v11_x64_线程安全版本
1.php配置文件修改:将php.ini-development修为php.ini
2.apache配置文件修改httpd.conf:在apache的配置文件尾部,追加
# php5 support,其中路径要用斜杠,LoadModule和PHPIniDir修改为自己对应的目录
LoadModule php5_module C:/ide/php/php-5.6.14/php5apache2_4.dll
AddType application/x-httpd-php .php .html .htm
# configure the path to php.ini
PHPIniDir "C:/ide/php/php-5.6.14"
php的xdebug2.3.3安装
官方地址:http://xdebug.org/
下载PHP 5.6 VC11 TS (64 bit) ,并拷贝php_xdebug-2.3.3-5.6-vc11-x86_64.dll到php安装目录的下面
修改php.ini文件,末尾追加,其中注意zend_extension,zend_extension_ts,extension。只配置zend_extension即可,其他不生效。
zend_extension = C:/ide/php/php-5.6.14/ext/php_xdebug-2.3.3-5.6-vc11-x86_64.dll
;zend_extension_ts = C:/ide/php/php-5.6.14/ext/php_xdebug-2.3.3-5.6-vc11-x86_64.dll
;extension=php_xdebug-2.3.3-5.6-vc11-x86_64.dll
[Xdebug]
;开启自动跟踪
xdebug.auto_trace = On
;开启异常跟踪
xdebug.show_exception_trace = On
;开启远程调试自动启动
xdebug.remote_autostart = On
;开启远程调试
xdebug.remote_enable = On
;收集变量
xdebug.collect_vars = On
;收集返回值
xdebug.collect_return = On
;收集参数
xdebug.collect_params = On
eclipse的debug配置
1.配置eclipse,修改PHP Excutables,把php安装目录配置上
同时修改PHP Excutables的子目录,Execution Environments,把5.6勾上
2.修改PHP/Debug/Debuggers的XDebug
3.修改PHP/Servers/Default PHP Web Server里面的端口,和htdocs
4.修改PHP/Debug,吧刚才设置的Excutables和Debuggers设置上
其中有个概念很重要,远程调试,服务器是eclipse,apache会主动来连接eclipse指定的IP和端口。apache里,默认远程端口是9000,地址是localhost。
后语
添加模块,从php.ini第849行开始
其中ts表示线程安全,nts表示线程不安全。
移动要注意版本的匹配,否则调试不通。
后续会上图,把eclipse的配置贴出来

php把负数转为正整数的方法:1、使用abs()函数将负数转为正数,使用intval()函数对正数取整,转为正整数,语法“intval(abs($number))”;2、利用“~”位运算符将负数取反加一,语法“~$number + 1”。

实现方法:1、使用“sleep(延迟秒数)”语句,可延迟执行函数若干秒;2、使用“time_nanosleep(延迟秒数,延迟纳秒数)”语句,可延迟执行函数若干秒和纳秒;3、使用“time_sleep_until(time()+7)”语句。

php除以100保留两位小数的方法:1、利用“/”运算符进行除法运算,语法“数值 / 100”;2、使用“number_format(除法结果, 2)”或“sprintf("%.2f",除法结果)”语句进行四舍五入的处理值,并保留两位小数。

判断方法:1、使用“strtotime("年-月-日")”语句将给定的年月日转换为时间戳格式;2、用“date("z",时间戳)+1”语句计算指定时间戳是一年的第几天。date()返回的天数是从0开始计算的,因此真实天数需要在此基础上加1。

php判断有没有小数点的方法:1、使用“strpos(数字字符串,'.')”语法,如果返回小数点在字符串中第一次出现的位置,则有小数点;2、使用“strrpos(数字字符串,'.')”语句,如果返回小数点在字符串中最后一次出现的位置,则有。

方法:1、用“str_replace(" ","其他字符",$str)”语句,可将nbsp符替换为其他字符;2、用“preg_replace("/(\s|\ \;||\xc2\xa0)/","其他字符",$str)”语句。

在PHP中,可以利用implode()函数的第一个参数来设置没有分隔符,该函数的第一个参数用于规定数组元素之间放置的内容,默认是空字符串,也可将第一个参数设置为空,语法为“implode(数组)”或者“implode("",数组)”。

php字符串有下标。在PHP中,下标不仅可以应用于数组和对象,还可应用于字符串,利用字符串的下标和中括号“[]”可以访问指定索引位置的字符,并对该字符进行读写,语法“字符串名[下标值]”;字符串的下标值(索引值)只能是整数类型,起始值为0。


Heiße KI -Werkzeuge

Undresser.AI Undress
KI-gestützte App zum Erstellen realistischer Aktfotos

AI Clothes Remover
Online-KI-Tool zum Entfernen von Kleidung aus Fotos.

Undress AI Tool
Ausziehbilder kostenlos

Clothoff.io
KI-Kleiderentferner

AI Hentai Generator
Erstellen Sie kostenlos Ai Hentai.

Heißer Artikel

Heiße Werkzeuge

Dreamweaver CS6
Visuelle Webentwicklungstools

Senden Sie Studio 13.0.1
Leistungsstarke integrierte PHP-Entwicklungsumgebung

SAP NetWeaver Server-Adapter für Eclipse
Integrieren Sie Eclipse mit dem SAP NetWeaver-Anwendungsserver.

mPDF
mPDF ist eine PHP-Bibliothek, die PDF-Dateien aus UTF-8-codiertem HTML generieren kann. Der ursprüngliche Autor, Ian Back, hat mPDF geschrieben, um PDF-Dateien „on the fly“ von seiner Website auszugeben und verschiedene Sprachen zu verarbeiten. Es ist langsamer und erzeugt bei der Verwendung von Unicode-Schriftarten größere Dateien als Originalskripte wie HTML2FPDF, unterstützt aber CSS-Stile usw. und verfügt über viele Verbesserungen. Unterstützt fast alle Sprachen, einschließlich RTL (Arabisch und Hebräisch) und CJK (Chinesisch, Japanisch und Koreanisch). Unterstützt verschachtelte Elemente auf Blockebene (wie P, DIV),

Herunterladen der Mac-Version des Atom-Editors
Der beliebteste Open-Source-Editor
