V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Nicksxs
V2EX  ›  PHP

关于 thinkphp 的求助(求轻拍

  •  
  •   Nicksxs · 2015-04-24 10:15:55 +08:00 · 3664 次点击
    这是一个创建于 3284 天前的主题,其中的信息可能已经有所发展或是发生改变。

    地址
    可以登录这个网址查看,
    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

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

    第二个问题sae的数据库明显不是localhost...配置问题
    axe
        7
    axe  
       2015-04-24 12:42:34 +08:00
    SAE 有指定的数据库配置, 在配置里面写SAE提供的那几个常量吧
    feiyuanqiu
        8
    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
        9
    iLtc  
       2015-04-24 13:16:37 +08:00
    ThinkPHP 3.1 的版本要在 SAE 上运行需要下载 SAE引擎版本(http://www.thinkphp.cn/down/356.html),这个会自动适配 SAE的数据库,并且自动将缓存写进 Memcache
    g8287694
        10
    g8287694  
       2015-04-24 17:06:00 +08:00
    @crabRunning
    那现在开发用什么?
    tanywei
        11
    tanywei  
       2015-04-24 18:18:41 +08:00
    居然敢用thinkphp。。。
    tanteng
        12
    tanteng  
       2015-04-25 00:36:15 +08:00 via iPhone
    @crabRunning 你们现在用什么框架
    111111111111
        13
    111111111111  
       2015-04-29 10:02:18 +08:00
    @tanywei 有什么坑吗?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2584 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 04:31 · PVG 12:31 · LAX 21:31 · JFK 00:31
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.