php相关笔记

211 阅读2分钟
1.重启Nginx

service nginx restart

2.重启PHP-fpm

service php-fpm restart

3.重启Apache

systemctl restart httpd.service

4.Apache 配置 指向域名 或者是虚拟域名

在httpd.conf 文件里添加如下

<VirtualHost *:80> 
    DocumentRoot /var/www/html
    ServerName www.linqinghu.cn
</VirtualHost>
​
​
<VirtualHost *:80> 
    DocumentRoot /var/www/html/my/public
    ServerName www.api.linqinghu.cn
</VirtualHost>
​
​
5.thinkphp 配置隐藏index.php

在httpd.conf 文件里添加如下

在ThinkPHP5.0中,出于优化的URL访问原则,还支持通过URL重写隐藏入口文件,下面以Apache为例说明隐藏应用入口文件index.php的设置。

下面是Apache的配置过程,可以参考下: 1、httpd.conf配置文件中加载了mod_rewrite.so模块 2、AllowOverride NoneNone改为 All 3、在应用入口文件同级目录添加.htaccess文件,内容如下:

<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine on
​
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>

6.phpstorm 配置ThinkPHP namespace

Directories--->Sources->SourceFolders-->小p;添加

7.centos7 lamp环境配置及多域名设置

blog.csdn.net/ruoshuiyx/a…

8 php 升级到5.6

blog.csdn.net/hailanzi/ar…

9 给文件夹创建权限

chmod -R 777 /var/www/html/my/public/images

10 https

1 生效 : LoadModule ssl_module modules/mod_ssl.so

<VirtualHost _default_:443>     
    DocumentRoot /var/www/html
    Servername www.linqinghu.cn
    ErrorLog logs/ssl_error_log
    TransferLog logs/ssl_access_log
    LogLevel warn
    SSLEngine on
    SSLCertificateFile /var/www/html/2_www.linqinghu.cn.crt
    SSLCertificateKeyFile /var/www/html/3_www.linqinghu.cn.key
</VirtualHost>
​
HTTP 80 强制转 HTTPS

全站采用https协议访问,所以需要http重定向到https,只需要在.htaccess加入下面规则

在相应的网站根目录新建 .htaccess

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R,L]

或者

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*) https://%{SERVER_NAME}/$1 [R,L]

mysql 追踪器

blog.csdn.net/heyuqing32/…

general_log=ON
general_log_file="D:/xampp/htdocs/mysql_bz.log"
​
phpgjx       ---------------config
​
'web_url'  =>'http://127.0.0.1/phpgjx/index.php', // php工具箱访问 url 根路径 
'mysql_log'=>'D:/xampp/htdocs/mysql_bz.log', // mysql 标准日志文件路径

上传视频 Call to a member function rule() on null

upload_max_filesize = 100m ;望文生意,即允许上传文件大小的最大值。默认为2M

post_max_size = 100M ;指通过表单POST给PHP的所能接收的最大值,包括表单里的所有值。默认为8M