# Cakephp on nginx causes error 500

**URL:** <https://discourse.cakephp.org/t/cakephp-on-nginx-causes-error-500/5548>\
**Category:** Need Help\
**Created:** [January 17, 2019, 10:36pm UTC](https://discourse.cakephp.org/t/cakephp-on-nginx-causes-error-500/5548 "2019-01-17T22:36:15Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryukotsei55](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@Ryukotsei55](https://discourse.cakephp.org/u/Ryukotsei55)\
**Post date:** [January 17, 2019, 10:36pm UTC](https://discourse.cakephp.org/t/cakephp-on-nginx-causes-error-500/5548/1 "2019-01-17T22:36:15Z")

</div>

Hello everyone!

I have done my cakephp 3 project on xampp, and wanted to put it via ftp on a nginx server. So followed the rules, but I have a 500 error.

I forgot to remove the tmp on the server. I removed it but nothing changed. I don’t know what’s happening because we get absolutely no errors logged.

I’ll send a copy of the nginx config when I get it, it’s a friend’s server.

Thank you for your help!

---

<div class="post-metadata">

**Author:** ![Graziel](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@Graziel](https://discourse.cakephp.org/u/Graziel)\
**Post date:** [January 17, 2019, 10:46pm UTC](https://discourse.cakephp.org/t/cakephp-on-nginx-causes-error-500/5548/2 "2019-01-17T22:46:34Z")

</div>

you can check nginx logs usually in `/var/logs/nginx/` i like to add `access_log` and `error_log` to point to cake logs dir,

when i have 500 it often helps to just login in ssh `cd` to `webroot` and `php index.php` its usually something simple like folder rights

---

<div class="post-metadata">

**Author:** ![Ryukotsei55](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@Ryukotsei55](https://discourse.cakephp.org/u/Ryukotsei55)\
**Post date:** [January 17, 2019, 10:57pm UTC](https://discourse.cakephp.org/t/cakephp-on-nginx-causes-error-500/5548/3 "2019-01-17T22:57:04Z")

</div>

Hello Graziel and thanks for your help!

We checked the error\_log file and there is nothing. So We don’t really know for now.

---

<div class="post-metadata">

**Author:** ![Zuluru](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/zuluru/32/1230_2.png) [@Zuluru](https://discourse.cakephp.org/u/Zuluru)\
**Post date:** [January 18, 2019, 1:17am UTC](https://discourse.cakephp.org/t/cakephp-on-nginx-causes-error-500/5548/4 "2019-01-18T01:17:33Z")

</div>

Anything in the Cake logs?

---

<div class="post-metadata">

**Author:** ![Ryukotsei55](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@Ryukotsei55](https://discourse.cakephp.org/u/Ryukotsei55)\
**Post date:** [January 18, 2019, 1:10pm UTC](https://discourse.cakephp.org/t/cakephp-on-nginx-causes-error-500/5548/5 "2019-01-18T13:10:42Z")

</div>

Hey Zuluru, I checked and saw nothing. Unless I checkd the wrong files but I don’t think I did

---

<div class="post-metadata">

**Author:** ![Zuluru](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/zuluru/32/1230_2.png) [@Zuluru](https://discourse.cakephp.org/u/Zuluru)\
**Post date:** [January 18, 2019, 4:24pm UTC](https://discourse.cakephp.org/t/cakephp-on-nginx-causes-error-500/5548/6 "2019-01-18T16:24:28Z")

</div>

Well then, time to start debugging. Try things like put an echo immediately followed by an exit at the top of the index.php. If that still gives the error, then it’s a server configuration (nginx or permissions, for example). If that works, then gradually move it lower and lower until you isolate the line that fails.

---

<div class="post-metadata">

**Author:** ![Ryukotsei55](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@Ryukotsei55](https://discourse.cakephp.org/u/Ryukotsei55)\
**Post date:** [January 18, 2019, 4:27pm UTC](https://discourse.cakephp.org/t/cakephp-on-nginx-causes-error-500/5548/7 "2019-01-18T16:27:29Z")

</div>

Index.php of webroot is that right?

EDIT: Indeed, I tried to echo “hello” and it indeed shows it, so I forgot to do something. I thank you so much!

---

<div class="post-metadata">

**Author:** ![Ryukotsei55](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@Ryukotsei55](https://discourse.cakephp.org/u/Ryukotsei55)\
**Post date:** [January 18, 2019, 4:52pm UTC](https://discourse.cakephp.org/t/cakephp-on-nginx-causes-error-500/5548/8 "2019-01-18T16:52:51Z")

</div>

I tried, and it stops working after the require /config/requirements.php

I looked into it, and it chacks if the php version is superior or equal to 5.6.0. The server runs on php 7.2, maybe that’s the problem?

---

<div class="post-metadata">

**Author:** ![Graziel](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@Graziel](https://discourse.cakephp.org/u/Graziel)\
**Post date:** [January 18, 2019, 5:20pm UTC](https://discourse.cakephp.org/t/cakephp-on-nginx-causes-error-500/5548/9 "2019-01-18T17:20:37Z")

</div>

`requirements.php` is a bunch of simple checks for you to make sure your env has all neccessary modules, while you say its 7.2 note that you can have different versions for `cli` and `fpm`

if you are 100% sure your env has all it needs you can even delete everything from `requirements.php` as stated in comment there

---

<div class="post-metadata">

**Author:** ![Ryukotsei55](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@Ryukotsei55](https://discourse.cakephp.org/u/Ryukotsei55)\
**Post date:** [January 18, 2019, 5:51pm UTC](https://discourse.cakephp.org/t/cakephp-on-nginx-causes-error-500/5548/10 "2019-01-18T17:51:07Z")

</div>

Tried the echo everywhere but it stops working after that $server-\>emit($server-\>run()); line.

I don’t really know what is going on.

---

<div class="post-metadata">

**Author:** ![Graziel](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@Graziel](https://discourse.cakephp.org/u/Graziel)\
**Post date:** [January 18, 2019, 6:31pm UTC](https://discourse.cakephp.org/t/cakephp-on-nginx-causes-error-500/5548/11 "2019-01-18T18:31:05Z")

</div>

it still should give you error anyway when you run it through ssh, its possible you have error display disabled in php.ini you can try adding on top of `index.php` these lines just to be sure

```auto
error_reporting(E_ALL);
ini_set('display_errors', 1);

```

---

<div class="post-metadata">

**Author:** ![Zuluru](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/zuluru/32/1230_2.png) [@Zuluru](https://discourse.cakephp.org/u/Zuluru)\
**Post date:** [January 18, 2019, 9:53pm UTC](https://discourse.cakephp.org/t/cakephp-on-nginx-causes-error-500/5548/12 "2019-01-18T21:53:25Z")

</div>

Have you got debug set to true in your `config/app.php`?

---

<div class="post-metadata">

**Author:** ![Ryukotsei55](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@Ryukotsei55](https://discourse.cakephp.org/u/Ryukotsei55)\
**Post date:** [January 18, 2019, 11:14pm UTC](https://discourse.cakephp.org/t/cakephp-on-nginx-causes-error-500/5548/13 "2019-01-18T23:14:19Z")

</div>

The error is solved. But now we have a problem. We can’t access anything. No css, no javascript, no other pages are available (error 404)

Even reading the documentation we can’t solve the problem. The server is Nginx. I’ll send more tomorrow,

But the Urls are good.I get the one I want when I click the link, the page just doesn’t appear. Only a 404 error.

---

<div class="post-metadata">

**Author:** ![Ryukotsei55](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@Ryukotsei55](https://discourse.cakephp.org/u/Ryukotsei55)\
**Post date:** [January 19, 2019, 2:19pm UTC](https://discourse.cakephp.org/t/cakephp-on-nginx-causes-error-500/5548/14 "2019-01-19T14:19:00Z")

</div>

But now we have a problem. We can’t access anything. No css, no javascript, no other pages are available (error 404)

Even reading the documentation we can’t solve the problem. The server is Nginx. I’ll send more tomorrow,

But the Urls are good.I get the one I want when I click the link, the page just doesn’t appear. Only a 404 error.  
And Yes I had debug activated to check on some errors

---

<div class="post-metadata">

**Author:** ![webeyesoft](https://avatars.discourse-cdn.com/v4/letter/w/ecccb3/32.png) [@webeyesoft](https://discourse.cakephp.org/u/webeyesoft)\
**Post date:** [May 6, 2019, 12:00pm UTC](https://discourse.cakephp.org/t/cakephp-on-nginx-causes-error-500/5548/15 "2019-05-06T12:00:19Z")

</div>

# 500 internal server error?

# Now I will tell How To fix 500 internal server error?

**Step 1 check .htaccess**

Most of the case invalid htacess code . some case after install wordpress plugin .htaccess become corrupted .

So what need to do . step 1 you need to take backup your current .htaccess file . Login to your cPanel and click on file manager then find public\_html folder , click on folder and find .htaccess file and rename this file as like you need . example .htaccess\_backup.

[Read continue](https://www.webeyesoft.com/500-internal-server-error)

---

<div class="post-metadata">

**Author:** ![FinlayDaG33k](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/finlaydag33k/32/1049_2.png) [@FinlayDaG33k](https://discourse.cakephp.org/u/FinlayDaG33k)\
**Post date:** [May 27, 2019, 2:11pm UTC](https://discourse.cakephp.org/t/cakephp-on-nginx-causes-error-500/5548/16 "2019-05-27T14:11:23Z")

</div>

So ehm… how does installing a WordPress plugin affect CakePHP? :^)
