首页 » Latest Post

买了php空间,但是不能直接设置强制https,那么可以修改.htaccess文件来完成

打开.htaccess文件,加入如下语句即可
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*) https://%{SERVER_NAME}/$1 [R,L]
完整如下
<IfModule mod_rewrite.c>
RewriteEngine On
# 下面是在根目录,文件夹要修改路径
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]

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

群晖内置nginx允许跨域访问

修改nginx 代理配置
vim /usr/syno/share/nginx/Portal.mustache
在location / 下面任意位置加入 : add_header Access-Control-Allow-Origin '*' always;

  location / {
        {{#customize_header_variable}}
        if (${{&.}} = false) {
            set ${{&.}} '';
        }
    {{/customize_header_variable}}

# →→ 比如在这里加入 ←←

 add_header Access-Control-Allow-Origin '*' always;
注意不能用webstation直接访问,要用控制面板----Application Portal----Reverse Proxy 代理端口访问。

群晖6用webstation搭建php站点,nginx 超时解决 nginx 504 Gateway Time-out

群晖自带的nginx不让修改配置,但是可以修改这个

切换root
sudo su -
修改nginx配置文件
vim /usr/syno/share/nginx/nginx.mustache
添加下面几行,可以搜文件中的send_timeout 处添加
 send_timeout                  600s;
    proxy_connect_timeout         600s;
    proxy_send_timeout            600s;
    proxy_read_timeout            600s;
重启nginx
synoservice --restart nginx
如果webstation后台用的apache,同时也要配置appache

cd /usr/local/etc/apache24/conf
vi httpd24.conf
 

在最后一行加入

Timeout 600
重启
synoservice --restart pkgctl-Apache2.4

IDEA调试php报错:Connection was not established. Cannot start debugger session with 'Xdebug 3.1.2' Validate installation

很不幸,xdebug3必须使用idea 2020以上,我得2019不行,因为idea生成得命令已经过时了
D:\tool\php\php.exe -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9000 -dxdebug.remote_host=127.0.0.1 D:\dev\myphp\main.php