关于 thinkphp 的求助(求轻拍

2015-04-24 10:15:55 +08:00
 Nicksxs

地址
可以登录这个网址查看,
nginx配置参考了
1.nginx配置
2.pathinfo

server {
listen 80;
server_name localhost;

root /var/www;
index index.html index.htm index.php;
#charset koi8-r;
#access_log  /var/log/nginx/log/host.access.log  main;

location / {
    try_files $uri $uri/ /index.php$is_args$args;
}

#error_page  404              /404.html;

# redirect server error pages to the static page /50x.html
#
error_page   500 502 503 504  /50x.html;
location = /50x.html {
    root   /usr/share/nginx/html;
}

# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
#    proxy_pass   http://127.0.0.1;
#}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
    try_files $uri = 404;
    fastcgi_pass   127.0.0.1:9000;
    fastcgi_split_path_info ^(.+\.php)($|/.*);
    fastcgi_split_path_info ^(.+.php)(.*)$;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    include        fastcgi_params;
}

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
#    deny  all;
#}

}

还有一个问题是thinkphp在sae上使用的时候的问题
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
错误位置
FILE: /data1/www/htdocs/520/cruise/1/ThinkPHP/Extend/Engine/Sae/Lib/Driver/Db/DbMysql.class.php  LINE: 78
ThinkPHP3.1.3 { Fast & Simple OOP PHP Framework } -- [ WE CAN DO IT JUST THINK ]
(不太会markdown

3676 次点击
所在节点    PHP
13 条回复
crabRunning
2015-04-24 10:35:29 +08:00
什么年代了还用thinkphp
Nicksxs
2015-04-24 11:13:01 +08:00
@crabRunning 我很渣的
crabRunning
2015-04-24 11:24:19 +08:00
@Nicksxs 吊炸天竟然用php7
hisokc
2015-04-24 11:27:40 +08:00
报的mysql错误,应该是mysql没启动或配置问题吧
crabRunning
2015-04-24 11:33:19 +08:00
别那么早用php ng人家还没正式发布,等别人把问题撸圆再用也不迟,如果你不是大神,遇到新版本的问题你去找鸟哥啊。还有nginx pathinfo 没有开启yeah
zts1993
2015-04-24 12:24:07 +08:00
nginx配置tp手册有。。还要开启pathinfo

第二个问题sae的数据库明显不是localhost...配置问题
axe
2015-04-24 12:42:34 +08:00
SAE 有指定的数据库配置, 在配置里面写SAE提供的那几个常量吧
feiyuanqiu
2015-04-24 12:57:22 +08:00
不能连接数据库你可以看下这几个地方:
1、ps -ef | grep mysql 看下 mysql 启动没有
2、ls /var/lib/mysql/mysql.sock 看下这个存不存在
3、mysql -u(你在php数据库连接配置文件里面设置的数据库用户名) -p 看下能不能登进去
4、如果数据库在远程,还要看下 iptables 的配置,是不是把远程访问数据库给 DROP 了
iLtc
2015-04-24 13:16:37 +08:00
ThinkPHP 3.1 的版本要在 SAE 上运行需要下载 SAE引擎版本(http://www.thinkphp.cn/down/356.html),这个会自动适配 SAE的数据库,并且自动将缓存写进 Memcache
g8287694
2015-04-24 17:06:00 +08:00
@crabRunning
那现在开发用什么?
tanywei
2015-04-24 18:18:41 +08:00
居然敢用thinkphp。。。
tanteng
2015-04-25 00:36:15 +08:00
@crabRunning 你们现在用什么框架
111111111111
2015-04-29 10:02:18 +08:00
@tanywei 有什么坑吗?

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/185925

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX