lnmp安装Tp5报500和404问题解决

lnmp为了防止跨目录访问在程序跟目录创建.user.ini,而tp5安装在lnmp创建时配置的时程序目录下的public文件夹,这样会导致其无法访问public的上层目录 解决办法时进入到lnmp的文件夹工具类   cd /root/lnmp1.5/tools 运行如下命令 ./remove_open_basedir_restriction.sh 选择要移除限制的目录 比如 /home/repository/va/public 然后cd到/home/repository/va/public目录 删除.user.ini 再次访问  就正常了

Mysql批量删除相同前缀的表

今天上午想备份一下微擎的数据库哎,打开phpmyadmin一看好几百张表,有些表是之前安装的应用自带的,现在不用了,不想备份这谢谢表了,就想着批量把相同前缀的这些表删掉。这里只写具体方法: use information_schema; SELECT CONCAT( 'DROP TABLE ', GROUP_CONCAT(table_name) , ';' ) AS statement FROM information_schema.tables WHERE table_schema = 'jiaozhou' AND table_name LIKE 'ims_mihua%'; 查询出来后,得到的statement语句形如下面这种格式: DROP TABLE ims_mihua_sq_account,ims_mihua_sq_address,ims_mihua_sq_admin,ims_mihua_sq_adv,ims_mihua_sq_area,ims_mihua_sq_balance,ims_mihua_sq_black,ims_mihua_sq_cart,ims_mihua_sq_cash,ims_mihua_sq_channel,ims_mihua_sq_chat,ims_mihua_sq_city,ims_mihua_sq_citys,ims_mihua_sq_collect,ims_mihua_sq_comment,ims_mihua_sq_discount,ims_mihua_sq_discount_record,ims_mihua_sq_fields,ims_mihua_sq_footmark,ims_mihua_sq_get_redpackage,ims_mihua_sq_goods,ims_mihua_sq_goods_cate,ims_mihua_sq_group,ims_mihua_sq_info,ims_mihua_sq_info_comment,ims_mihua_sq_infoorder,ims_mihua_sq_integral,ims_mihua_sq_member,ims_mihua_sq_msg,ims_mihua_sq_mstime,ims_mihua_sq_option,ims_mihua_sq_order,ims_mihua_sq_order_goods,ims_mihua_sq_order_record,ims_mihua_sq_param,ims_mihua_sq_qiandao,ims_mihua_sq_redmsg,ims_mihua_sq_redpackage,ims_mihua_sq_refund,ims_mihua_sq_ring,ims_mihua_sq_ring_zan,ims_mihua_sq_sensitiveword,ims_mihua_sq_share_history,ims_mihua_sq_shop,ims_mihua_sq_shop_admin,ims_mihua_sq_shop_apply,ims_mihua_sq_shop_cate,ims_mihua_sq_shop_cfg,ims_mi; 复制sql语句到phpmyadmin里面执行一下就ok了  2018.10.10补充 最近发现用group_concat 如果查询字段过长会出现查询数据展示不全的问题,原因是group_concat 有个默认长度配置  group_concat_max_len  用  show varialbes like 'group_concat_max_len' 可以查询该长度  默认是1024 那么解决方法就是改变这个配置咯   SET SESSION group_concat_max_len = 10240; or SET GLOBAL group_concat_max_len = 10240; 接下来在查询一下 : SELECT CONCAT( 'DROP TABLE ', GROUP_CONCAT(table_name SEPARATOR ' ') , ';' ) AS statement FROM information_schema.tables WHERE table_schema = 'wq' AND table_name LIKE 'ims_ewei%'; 完美~

Android Apktool工具解包修改合重新打包过程

很早就一直在用apktool工具了,但是一直局限于解包看layout的接口等,反编译的时候基本上都用封装好的jadx-gui(加壳的可能得先要去壳)。 今天简单的看了下apktool官方文档,尝试了解包 打包 再签名的过程 。   1.requirements     jdk7+   2. apktool  https://ibotpeaches.github.io/Apktool/install/ (我这需要跨过gfw) 操作步骤: 一. 解包   apktool d xxxx.apk 二.修改图片文字信息 三. 生成签名  keytool -genkey -alias adam.keystore -keyalg RSA -validity 20000 -keystore adam.keystore 四.生成APK  apktool b xxxx -o adam.apk 五.APK签名 jarsigner -verbose -keystore adam.keystore -signedjar adam_signed.apk adam.apk adam.keystore over

Mysql存储base64图片引发的问题

今天运营跑过来问我说编辑器的文章提交后存储不了,首先我想到的是是不是后端小伙伴是不是在数据库表设计的时候用的varchar 或者text超过了长度限制,然而检查了一下并不是。 查阅了半天文档发现是mysql配置的问题,解决方法当然是修改mysql配置了: /etc/my.cnf下,max_allowed_packet默认是1M,改成10M重启mysql就ok了。 max_allowed_packet是mysql服务端和客户端消息的最大限制配置,由于前端编辑器把上传的图片都转换成了base64编码,图片上传的多的时候会超过max_allowed_packet默认配置,所以保存不了。 参考官方文档:  https://dev.mysql.com/doc/refman/8.0/en/replication-features-max-allowed-packet.html

Centos7安装wkhtmltopdf并解决中文问题

最近帮朋友公司做一个关于知识产权的项目,其中一个需求是把富文本编辑器里的内容转化成pdf然后打包下载下来。 小伙伴刚开始采用了tcpdf直接把html text导出了pdf,但是这种情况下会出现不少问题,html很多样式都渲染不出来。于是乎只好另寻其他方法,然后就开始尝试wkhtmltopdf,最终效果比tcpdf要好。下面记录了一下安装过程,ps:服务器是centos 7  #下载 wkhtmltopdf rpm安装包  cd /root wget https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox-0.12.5-1.centos7.x86_64.rpm #安装依赖   这些都执行下,否则安装会出问题  yum install -y libpng     yum install -y libjpeg     yum install -y openssl     yum install -y icu     yum install -y libX11     yum install -y libXext     yum install -y libXrender     yum install -y xorg-x11-fonts-Type1     yum install -y xorg-x11-fonts-75dpi     #安装字体  yum install wqy-zenhei-fonts rpm -Uvh wkhtmltox-0.12.5-1.centos7.x86_64.rpm 然后没啥了。 尝试  wkhtmltopdf   /root/adam.pdf 参考   https://gist.github.com/paulsturgess/cfe1a59c7c03f1504c879d45787699f5

Centos利用qshell自动备份程序上传到七牛云

安装qshell   cd /root wget  http://devtools.qiniu.com/qshell-v2.1.8.zip unzip qshell-v.2.1.8.zip mkdir tool mv qshell_linux_x64 ./tool/qshell   2.添加全局访问   vim ~/.bashrc 插入   export PATH=$PATH:/root/tool  3. 编写压缩备份脚本  vim folderback.sh #!/bin/sh BACK_DIR="/home/repository/programbackup/"   #压缩目录 BACK_TARGET="/home/repository/nongwanyun/"   #目标目录 DATE=`date +%F` zip -rP 密码 $BACK_DIR"nongwanyun_back_"$DATE.zip $BACK_TARGET chmod +x folderback.sh 4. 编写七牛云配置文件  cd /root/tool/ mkdir conf cd conf touch qshell.conf vim qshell.conf #输入  {    "src_dir"            :   "/home/repository/programbackup", #要备份的目录    "bucket"             :   "backup",    "key_prefix"         :   "nongwanyun/",    "access_key"         :   "七牛ak",    "secret_key"         :   "七牛sk",    "up_host"            :   "",    "ignore_dir"         :   false,    "overwrite"          :   false,    "check_exists"       :   false,    "check_hash"         :   false,    "check_size"         :   false,    "rescan_local"       :   true,    "skip_file_prefixes" :   "test,demo,",    "skip_path_prefixes" :   "hello/,temp/",    "skip_fixed_strings" :   ".svn,.git",    "skip_suffixes"      :   ".DS_Store,.exe",    "log_file"           :   "upload.log",    "log_level"          :   "info",    "log_rotate"         :   1,    "log_stdout"         :   false } 5.编写qshell上传脚本 cd /root touch folderupload.sh vim folderupload.sh  #插入  #!/bin/sh … Read more

linux日常命令

vi/vim 清空文件内容:     方法1:  键盘g  ->  输入  .,$d    方法2:     cat /dev/null > filename   方法3: echo "" > filename   方法4: > filename  方法5: ECS  然后输入dG 磁盘挂载: fdisk -l fdisk  /xxxx   #新增数据盘  n 新增分区   e 延伸分区  1 partion number  2028  first sector  enter last sector  w 写入 partprobe 同步数据盘   mkfs -t ext4 /xxx    设置系统所需格式 mkdir /mnt/adam  新建挂载路径  mount /xxx /mnt/adam  挂载 df -TH查看 

centos7.2 安装xdebug

下载 到官网下载源码  https://xdebug.org/download.php cd /wwwroot https://xdebug.org/files/xdebug-2.7.0alpha1.tgz 2.解压安装 mkdir xdebug   #创建目录 cp xdebug-2.7.0alphal.tgz –target-directory=./xdebug  #拷贝到创建目录 cd xdebug  #进入目录 tar -xvf xdebug-2.7.0alphal.tgz  #解压 cd xdebug-2.7.0alphal  /usr/local/php/bin/php -m  #查看是否已经看装模块  /usr/local/php/bin/phpize ./configure –with-php-config=/usr/local/php/bin/php-config make && make instal #编译安装 3.安装成功会提示 Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-non-zts-20170718/   +———————————————————————-+   |                                                                      |   |   INSTALLATION INSTRUCTIONS                                          |   |   =========================                                          |   |                                                                      |   |   See http://xdebug.org/install.php#configure-php for instructions   |   |   on how to enable Xdebug for PHP.                                   |   |                                                                      |   |   Documentation is available online as well:                         |   |   – A list of all settings:  http://xdebug.org/docs-settings.php     |   |   – A list of all functions: http://xdebug.org/docs-functions.php    |   |   – Profiling instructions:  http://xdebug.org/docs-profiling2.php   |   |   – Remote debugging:        http://xdebug.org/docs-debugger.php     |   |                                                                      |   |                                                                      |   |   NOTE: Please disregard the message                                 |   |       You should add "extension=xdebug.so" to php.ini                |   |   that is emitted by the PECL installer. This does not work for      |   |   Xdebug.                                                            |   |                                                                      |   +———————————————————————-+ 4.php.ini添加扩展    cd /usr/local/php/etc  vim php.ini   #最后一行写入    [xDebug] zend_extension = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20170718/xdebug.so" 5.  echo phpinfo();查看

Mysql报错:Invalid datetime format: 1292 Truncated incorrect DOUBLE value: 问题及解决办法

今天oauth登陆遇到个问题,第一次登陆没啥为题,第二次登陆mysql报错:Invalid datetime format: 1292 Truncated incorrect DOUBLE value: ‘xxxxxxxxx’ google一下原因表的字段‘openid’是varchar类型,oauth获取github accesstoken返回的是一个数字,解决方法就是把数字转换成字符串咯~    $openid.""