PHP入门及技术指南

1. PHP基础介绍

初识PHP

参考地址

php中文网:http://www.php.cn/ 

php中国开发者社区:http://www.phpchina.com/

版本

当前最新版本7.3.x,历史常用版本5.2.17~5.6.x

服务器

phpstudy、lamp、Apache、Nginx等

开发辅助工具

https://php.net/    //php在线查找帮助,包含php所有方法函数用法及说明,非常全面

 

常用操作指令

  • 查看php版本: # php -v 
  • 查看php环境及配置信息: # php -ini|more
  • 查看php加载扩展模块:# php -m

魔术常量

  • __LINE__    //当前的行数
  •  __FILE__    //当前文件绝对路径及文件名
  •  __DIR__      //当前文件绝对路径
  •  __CLASS__   //当前的类名
  •  __FUNCTION__     //当前的函数(方法)名
  •  __METHOD__     //类的方法名
  •  __NAMESPACE__      //命名空间[不常用]

2. PHP安装

当前系统环境:centos 7.4

# nohup wget -c https://www.php.net/distributions/php-7.2.17.tar.gz -b &

(wget https://www.php.net/distributions/php-7.2.17.tar.gz)

//注:下载有些慢,不可中断。约19M左右,若下载不完整,解压会报错,若存在问题,可用下载工具下载完整后上传

# tar zxvf php-7.2.17.tar.gz

# cd php-7.2.17

# ./configure  --help

# ./configure --prefix=/usr/local/php72 --enable-fpm \--enable-mbstring --enable-pdo --with-curl --disable-debug --disable-rpath \--enable-inline-optimization --with-bz2 --with-zlib --enable-sockets \--enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex \--with-mhash --with-mysqli \--with-gd --with-jpeg-dir --with-freetype-dir --enable-calendar

(参考:\--with-curl \--with-freetype-dir \--with-gd \--with-gettext \--with-iconv-dir \--with-kerberos \--with-libdir=lib64 \--with-libxml-dir \--with-mysqli \--with-openssl \--with-pcre-regex \--with-pdo-mysql \--with-pdo-sqlite \--with-pear \--with-png-dir \--with-xmlrpc \--with-xsl \--with-zlib \--enable-fpm \--enable-bcmath \--enable-libxml \--enable-inline-optimization \--enable-gd-native-ttf \--enable-mbregex \--enable-mbstring \--enable-opcache \--enable-pcntl \--enable-shmop \--enable-soap \--enable-sockets \--enable-sysvsem \--enable-xml \--enable-zip)

# make && make install

 

 

3. PHP代码

<?php

echo  phpinfo();

?>

 

持续完善,待续...

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

云焰

你的鼓励是我创作的最大动力。

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值