short-link
short-link copied to clipboard
安装提示 check the manual that corresponds to your MariaDB server version for the right syntax to use near 'json
æ¨å¥½ï¼è¯·é®ï¼
Executing CREATE ls_user
: Success
Executing CREATE ls_link
: Success
Executing CREATE ls_log
: string(223) "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'json )ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci' at line 13" Failed
Executing CREATE ls_query_log
: Success
æ¯ä¸æ¯æ MariaDb åï¼
ç¯å¢ï¼ centos7 php 7.1 nginx 1.8.1 MariaDb 10.1.26
ä½ å¥½ï¼
MariaDB æ¯ä» Mysql è¡çèæ¥ï¼ç论ä¸æ¯æ¯æçã
ææ¥äºä¸ä¸ç¸å ³ææ¡£ï¼åºè¯¥æ¯ä½ æ使ç¨ççæ¬å°ä¸æ¯æ json ç±»åï¼è¯¥ç¹æ§å¨10.2 被å å ¥ï¼åè MariaDB: JSON datatype supported as of 10.2 https://ma.ttias.be/mariadb-json-datatype-supported-10-2/
å级MariaDBçæ¬åºè¯¥å°±è½è§£å³è¯¥é®é¢ã
qianji [email protected] äº2018å¹´12æ26æ¥å¨ä¸ ä¸å11:18åéï¼
æ¨å¥½ï¼è¯·é®ï¼
Executing CREATE ls_user: Success Executing CREATE ls_link: Success Executing CREATE ls_log: string(223) "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'json )ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci' at line 13" Failed Executing CREATE ls_query_log: Success
æ¯ä¸æ¯æ MariaDb åï¼
ç¯å¢ï¼ centos7 php 7.1 nginx 1.8.1 MariaDb 10.1.26
â You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/newnius/short-link/issues/3, or mute the thread https://github.com/notifications/unsubscribe-auth/AKu2pGJEb-mZAt9jXoy7f1c6mLMpcMp3ks5u8uqAgaJpZM4ZhUoC .
好的,感谢,我先做个尝试后再反馈
ä½ å¥½ï¼ MariaDB æ¯ä» Mysql è¡çèæ¥ï¼ç论ä¸æ¯æ¯æçã ææ¥äºä¸ä¸ç¸å ³ææ¡£ï¼åºè¯¥æ¯ä½ æ使ç¨ççæ¬å°ä¸æ¯æ json ç±»åï¼è¯¥ç¹æ§å¨10.2 被å å ¥ï¼åè MariaDB: JSON datatype supported as of 10.2 https://ma.ttias.be/mariadb-json-datatype-supported-10-2/ å级MariaDBçæ¬åºè¯¥å°±è½è§£å³è¯¥é®é¢ã qianji [email protected] äº2018å¹´12æ26æ¥å¨ä¸ ä¸å11:18åéï¼ â¦ æ¨å¥½ï¼è¯·é®ï¼ Executing CREATE ls_user: Success Executing CREATE ls_link: Success Executing CREATE ls_log: string(223) "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'json )ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci' at line 13" Failed Executing CREATE ls_query_log: Success æ¯ä¸æ¯æ MariaDb åï¼ ç¯å¢ï¼ centos7 php 7.1 nginx 1.8.1 MariaDb 10.1.26 â You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#3>, or mute the thread https://github.com/notifications/unsubscribe-auth/AKu2pGJEb-mZAt9jXoy7f1c6mLMpcMp3ks5u8uqAgaJpZM4ZhUoC .
æ¨å¥½ï¼æ´æ°ä¸º MariaDB 10.3 åå®è£
å
¨é¨æåï¼ä½æ¯ä½¿ç¨æ¶æ示 ï¼
Request failed :error
请æå¦ä½å¤çï¼å¹¶ä¸ nginx åºè¯¥å¦ä½è®¾ç½®ä¼ªéæï¼å½åææ¯ç´æ¥æ .htaccess å çè§ååäºä¸è½¬æ¢ã
å¦å¤ï¼ææ³è®¾ç½®é¿åº¦æç为 3-15ä½ï¼åºè¯¥å¦ä½è®¾ç½®ï¼ææ URL_MIN_LENGTH
设置为 3 好åæ æ³çæã
你好
关于自定义网址长度限制修改
对应的配置参数是 TOKEN_MIN_LENGTH
和TOKEN_MAX_LENGTH
,需要同时修改 config.inc.php
和 static/config.js
这两个配置文件
URL_MIN_LENGTH
和 URL_MAX_LENGTH
是用于限制原始网址长度的参数
关于错误信息
应该是没有启用伪静态,导致的接口地址404
Nginx 的伪静态重写规则
我用的是apache,nginx 只用于透明代理。你可以参考 NGINX中的proxy_pass和rewrite 来重写伪静态配置。
需要重写的apache规则文件在 .htaccess
感谢,修正 nginx 伪静态后正常使用
rewrite ^/api$ /404.php;
rewrite ^/about$ /404.php;
rewrite ^/pricing$ /404.php;
rewrite ^/admin$ /404.php;
rewrite ^/login$ /404.php;
rewrite ^/service$ /ajax.php;
rewrite ^/auth$ /auth.php;
rewrite ^/help$ /help.php;
rewrite ^/ucenter$ /ucenter.php;
rewrite ^/([0-9a-zA-Z]+)$ /redirect.php?token=$1;
感谢,修正 nginx 伪静态后正常使用
rewrite ^/api$ /404.php; rewrite ^/about$ /404.php; rewrite ^/pricing$ /404.php; rewrite ^/admin$ /404.php; rewrite ^/login$ /404.php; rewrite ^/service$ /ajax.php; rewrite ^/auth$ /auth.php; rewrite ^/help$ /help.php; rewrite ^/ucenter$ /ucenter.php; rewrite ^/([0-9a-zA-Z]+)$ /redirect.php?token=$1;
请教一下您的伪静态是怎么写的。 我现在的情况是点登陆这些会要求下载undefined的文件,缩短地址也会出现something wrong的提示。 不知道是不是伪静态的问题,盼回。
@newnius 您好,请问我如果想修改自定义短网址支持带.和-这2个标点符号,应该如何修改?谢谢
@newnius 您好,请问我如果想修改自定义短网址支持带.和-这2个标点符号,应该如何修改?谢谢
你好,多谢关注。需要修改以下几处正则表达式:
https://github.com/newnius/short-link/blob/6e7d6424281dd20a522da2629d0e221ee062c295/static/link.js#L29
/^([a-zA-Z0-9]\.-)+$/
https://github.com/newnius/short-link/blob/6e7d6424281dd20a522da2629d0e221ee062c295/.htaccess#L17
RewriteRule ^([0-9a-zA-Z\.-]+)$ /redirect.php?token=$1
.
和 -
都是特殊字符,需要转义。
@newnius 非常棒!特别感谢您写了这么好的系统!终于可以用上我的短域名了!哈~ 对了,如果我想实现生成的域名带上个前缀怎么办呢?譬如现在是www.short.com/abc123 我想改成www.short.com/?u=abc123 这样呢?
@newnius 非常棒!特别感谢您写了这么好的系统!终于可以用上我的短域名了!哈~ 对了,如果我想实现生成的域名带上个前缀怎么办呢?譬如现在是www.short.com/abc123 我想改成www.short.com/?u=abc123 这样呢?
你试试看这样行不行,不太确定
https://github.com/newnius/short-link/blob/6e7d6424281dd20a522da2629d0e221ee062c295/.htaccess#L17
RewriteRule ^\?u=([0-9a-zA-Z]+)$ /redirect.php?token=$1
如果不行的话,就需要在index.php
里把redirect.php
文件内容复制进去再修改一下了。
其他需要修改的地方
https://github.com/newnius/short-link/blob/6e7d6424281dd20a522da2629d0e221ee062c295/static/main.js#L53
@newnius 您好,我按照您的方法修改后,前台设置自定义网址的时候,提示无效的自定义网址,只支持字母,数字。
short-link/static/link.js Line 29 in 6e7d642 var pattern = /^([a-zA-Z0-9])+$/; /^([a-zA-Z0-9].-)+$/ short-link/.htaccess Line 17 in 6e7d642 RewriteRule ^([0-9a-zA-Z]+)$ /redirect.php?token=$1 RewriteRule ^([0-9a-zA-Z.-]+)$ /redirect.php?token=$1 . 和 - 都是特殊字符,需要转义。
我测试了下,是可以的。
这个错误是 static/link.js
文件里的,你看下有没有修改对应的正则,如果已经修改了,可能是浏览器缓存,你试下清空浏览器缓存。
@newnius
//var pattern = /^([a-zA-Z0-9].-)+$/; var pattern = /^([a-zA-Z0-9].-)+$/; if (!pattern.test(token)) { $("#form-link-msg").html("无效的自定义网址,仅支持字母、数字"); return true;
是改成这样么?我这边换了浏览器还是提示那个错误~尴尬~我是小白 不好意思啊
/^([a-zA-Z0-9]\.-)+$/
你没加转义字符
@newnius
/^([a-zA-Z0-9].-?:)+$/
您的意思是这样么?貌似我这样弄了还是不行.... 真抱歉耽误您时间了。
呀? 反斜杠被自动过滤了。。。。。我刚才明明再每个标点符号前面加上了反斜杠。。
呀? 反斜杠被自动过滤了。。。。。我刚才明明再每个标点符号前面加上了反斜杠。。
可能是IDE自动处理掉了吧