![]() |
codeigniter + nginx + php-fpm - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: codeigniter + nginx + php-fpm (/showthread.php?tid=36180) |
codeigniter + nginx + php-fpm - El Forum - 11-24-2010 [eluser]luisfmgoncalves[/eluser] Hey guys. I developed a webpage with codeigniter and apache. I use Ubuntu in the computer I developed the application. After that and when I try to upload to the production server, the system administration told me that the application should run in nginx and with php-fpm. Oh, and he told me that the Linux distribuiton is CentOS. Since that moment I realized that I will get problems for sure. So, after I upload the project to the server, I get a 504 Gateway Timeout . And the good thing is that I don't have access to the nginx error.log... O.O Anyway, after this, I decided to install the same version of nginx and php in the computer I developed (with Ubuntu) and make it work and after that upload the project the server. I make it work in my computer but was still not working in the server. I decided to upload a clean version of codeigniter and started to had code till I get the error. With this method I realized that something was not working properly. In the project I have a template view with the following code: Code: <?php where $main_content is a variable that I assign with whatever I want. But, the problem is that in the server this line: Code: $this->load->view('include/header_view'); simple don't work! Looks like I can't load a view from another view. I don't know if this is something related with paths... Maybe is a CentOS thing, because in my Ubuntu everything works good with nginx and php-fpm. I'm not a Red Hat user, so maybe I'm missing something... I also tried to load the header from the same folder: Code: $this->load->view('header_view'); But doesn't work. If I call directly the header_view file, than works fine! This is something I can change... I just need to rewrite some views and I make it work... But I'm curious about what is wrong! My nginx.conf file is like this: Code: server { Is the problem related with this configuration? Any of you had this problem before? Thanks, Luis P.S.: PHP 5.3.3 (php modules from remi repositories) CentOS 5.5 mysql Codeigniter 1.7.2 codeigniter + nginx + php-fpm - El Forum - 11-24-2010 [eluser]bretticus[/eluser] The problem is not codeigniter and there's nothing you can do with your code to get it working. Case in point, it works fine on your installation but not on the server. You will most likely need to get into contact with the administrator for nginx. By the way, here's a snippet of my nginx php-fpm codeiniter config. Works great. Code: location / { codeigniter + nginx + php-fpm - El Forum - 11-30-2010 [eluser]luisfmgoncalves[/eluser] Hello, and thanks for your response. Actually I manage to make it work, at least part of it. I'm having another problem now and I have no idea how to solve it. The thing is, in the webpage I have, if a user click in a button I have there, the application should generate a file and send it to the browser, so the user can get it. I'm not sure which is the source of the problem, because I'm just getting a 404 but I suppose is because of the headers I'm using. Is that possible? In Apache this part is working nice with the following headers: Code: header("Cache-Control: public"); But with nginx this is not working. The file is generated, because if I go the destination folder, the file is there, but this file is not sent to the browser. Other thing, my project is in /var/www/project and the generated files are stored in /home/user/generated. Is this a problem? In the log I'm just getting the 'No such file or directory' explain in the following link (in Error log section): http://articles.slicehost.com/2010/8/27/reading-nginx-web-logs So I think the problem is not related with that... Any of you knows anything about this? Thanks, Luis |