Hello 前端俱乐部


  • 首页

  • 分类

  • 时间轴

  • 面试题

  • 私生活

  • 搜索

【Python零基础学习】python 2.7.x升级刀3.6.X

发表于 2021-03-06   |   分类于 Python零基础学习

centos7 服务器下想把python2.7.X升级到3.6

下载

wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tgz

1
[me@VM_0_8_centos ~]# wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tgz

解压tgz包

tar -zxvf Python-3.6.4.tgz

阅读全文 »

如何查看mysql的历史命令

发表于 2020-10-08   |   分类于 MySQL

.mysql_history 文件

1
2
3
4
5
6
[me@VM_0_14_centos ~]# cat ~/.mysql_history
source ./user.sql
show tables;
show tables;
show tables;
...

按关键字搜索

1
2
3
[me@VM_0_14_centos ~]# cat ~/.mysql_history | grep alter
alter table courses change name course_name varchar;
...

阅读全文 »

PHP如何判断函数/类/属性/方法是否存在

发表于 2020-10-07   |   分类于 PHP开发集锦

php判断函数是否存在
bool function_exists($funcName)
{

}

1
function_exists('myFuncName');

php判断类是否存在

阅读全文 »

【微信小程序自学之路】如何开发自定义tabBar

发表于 2020-09-16   |   分类于 微信小程序自学之路

微信小程序开发越来越多样化,各种丰富的设计及体验,自定义tabBar也经常使用,如:
自定义tabBar

我们来看下如何开发一个自定义的tabBar

小程序官网也有个DEMO,但是我觉得小程序文档的有很多细节没有写全,都以为大家是微信小程序开发团队,啥都知道一样。

下面是一个代码DEMO,我们将逐一讲解

阅读全文 »

【ThinkPHP入门学习】ThinkPHP连接数据库乱码问题

发表于 2020-09-15   |   分类于 PHP开发集锦

ThinkPHP5 通过PDO 连接MySQL数据库,出现读取中文的内容,乱码问题,各种问号???

乱码当然是编码不一致的问题,解决问题的一个办法是:

在application/database.php添加一个编码选项,在params配置里面添加

PDO::MYSQL_ATTR_INIT_COMMAND => ‘SET NAMES utf8’

详细配置如下

阅读全文 »

php5.6数据库连接失败--could not find driver 一一详解

发表于 2020-09-14

这个问题很多人经常遇到,解决这个问题首先我们得深究问题原因,下面我们一一详解

问题描述很明确:php连接连接数据库的时候,找不到数据库驱动,比如mysql驱动

这个问题大多数和mysql有关

我们目前的配置信息如下:

1
2
3
4
5
6
7
[root@VM_0_14_centos think]# mysql --version
mysql Ver 15.1 Distrib 5.5.65-MariaDB, for Linux (x86_64) using readline 5.1
[root@VM_0_14_centos think]# php -v
PHP 5.6.40 (cli) (built: Jan 12 2019 13:11:15)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

php 5.6版本,mysql 5.5版本

阅读全文 »

php扩展模块extension_dir的目录路径在哪

发表于 2020-09-14   |   分类于 PHP开发集锦

问:如何查看php扩展模块的路径?extension_dir

答:php -i | grep -i extension_dir

1
2
3
[root@VM_0_14_centos application]# php -i | grep -i extension_dir
extension_dir => /usr/lib64/php/modules => /usr/lib64/php/modules
sqlite3.extension_dir => no value => no value

Nginx unix:/tmp/php-cgi.sock

发表于 2020-09-14   |   分类于 Nginx详解

在配置Nginx和php-fpm的时候,我们有时候需要修改通信方式

默认一般是tcp的方式,也就是我们在php-fpm配置文件看到的

1
2
3
4
5
6
7
8
9
10
11
12
[www]

; The address on which to accept FastCGI requests.
; Valid syntaxes are:
; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on
; a specific port;
; 'port' - to listen on a TCP socket to all addresses on a
; specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
listen = 127.0.0.1:9000
...

阅读全文 »

Nginx错误日志connect() to unix:/tmp/php-cgi-56.sock failed (2 No such file or directory)

发表于 2020-09-14   |   分类于 Nginx详解

在配置Nginx + ThinkPHP5.0的时候,Nginx error log出现类似这样的错误:

1
2
3
4
2020/09/14 13:29:35 [crit] 2872#0: *6 connect() to unix:/tmp/php-cgi-56.sock failed 
(2: No such file or directory) while connecting to upstream, client: 119.136.91.154,
server: www.xxx.com, request: "GET /login/index.html HTTP/1.1",
upstream: "fastcgi://unix:/tmp/php-cgi-56.sock:", host: "xxx.com"

什么原因呢?一般原因有如下几种,

阅读全文 »

Nginx中if判断条件详解

发表于 2020-09-14   |   分类于 Nginx详解

我们经常在Nginx配置中看到一些if条件判断,及一些复杂判断语句,类似于

1
2
3
4
5
location / {
if (!-e $request_filename){
rewrite ^(.*)$ /index.php;
}
}

这个if里面就有个 !-e 判断,这个是什么意思呢?我们来看两种

阅读全文 »

1234…32
312 日志
24 分类
友情链接
  • 首页
  • 友链
最新发表文章
  • 【Py
    2021-03-06
    【Python零基础学习】python 2.7.x升级刀3.6.X
  • 如何查
    2020-10-08
    如何查看mysql的历史命令
  • PHP
    2020-10-07
    PHP如何判断函数/类/属性/方法是否存在
  • 【微信
    2020-09-16
    【微信小程序自学之路】如何开发自定义tabBar
  • 【Th
    2020-09-15
    【ThinkPHP入门学习】ThinkPHP连接数据库乱码问题
热门分类
  • 程序员
    各种八卦
    程序员的私生活
  • 自学
    转行自学
    前端自学之路
  • 小程序
    自己开发小程序
    微信小程序自学之路
  • Python
    爬虫、AI
    Python零基础学习
© 2021 Difashi 由 Hexo 提供
访客数人 总访问量人