Heroku+jekyll deployment appends index.html to AJAX post - php

I have an ajax call being made that posts to /php/rsvp.php. For some reason when this call goes through the web server, index.html is appended onto the path. The app is hosted on heroku using puma. Logs with the stacktrace are below:
2015-10-12T01:48:57.898961+00:00 heroku[router]: at=info method=POST path="/php/rsvp.php" host= request_id= fwd="" dyno=web.1 connect=1ms service=9ms status=500 bytes=168
2015-10-12T01:48:57.901579+00:00 app[web.1]: 2015-10-12 01:48:57 +0000: Rack app error: #<Errno::ENOTDIR: Not a directory # rb_sysopen - /app/_site/php/rsvp.php/index.html>
2015-10-12T01:48:57.901635+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/rack-jekyll-0.4.1/lib/rack/jekyll/helpers.rb:14:in `initialize'
2015-10-12T01:48:57.901639+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/rack-jekyll-0.4.1/lib/rack/jekyll/helpers.rb:14:in `open'
2015-10-12T01:48:57.901640+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/rack-jekyll-0.4.1/lib/rack/jekyll/helpers.rb:14:in `file_info'
2015-10-12T01:48:57.901642+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/rack-jekyll-0.4.1/lib/rack/jekyll.rb:75:in `call'
2015-10-12T01:48:57.901644+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/puma-2.9.1/lib/puma/configuration.rb:71:in `call'
2015-10-12T01:48:57.901645+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/puma-2.9.1/lib/puma/server.rb:490:in `handle_request'
2015-10-12T01:48:57.901647+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/puma-2.9.1/lib/puma/server.rb:361:in `process_client'
2015-10-12T01:48:57.901649+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/puma-2.9.1/lib/puma/server.rb:254:in `block in run'
2015-10-12T01:48:57.901652+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/puma-2.9.1/lib/puma/thread_pool.rb:92:in `call'
2015-10-12T01:48:57.901692+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/puma-2.9.1/lib/puma/thread_pool.rb:92:in `block in spawn_thread'
I've been looking through the puma and rack-jekyll functions to find where the append is happening, but none of the conditions are making sense. I also have yet to find any other post on this issue, which makes me think there is something simple I am overseeing. The ajax call being made is pretty straightforward:
req = $.post( '/rsvp.php', $form.serialize(), function(data, status){});
Is there some configuration I am missing to prevent this? My Gemfile, _config.yml, config.ru, etc. are identical to the ones here.

So we were having this problem too, and only just figured it out. The issue is that the rack-jekyll gem has a bug where it assumes that files without mime types are directories. See issue: https://github.com/adaoraul/rack-jekyll/issues/38
The bugfix is already done and it seems like it'll get released with 0.4.3, but in the meantime we managed to fix the problem by adding the following line to our config.ru file, which adds a mime type for .php extensions:
Rack::Mime::MIME_TYPES.merge!({".php" => "application/octet-stream"})

Related

Symfony Monolog container error once every 500 requests

Since upgrading to PHP 8.1, Symfony 6.1, Monolog 3.2, I have been seeing a PHP fatal error while constructing the Symfony DI container:
2022/12/12 04:10:02 [error] 31#31: *919 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught TypeError: Monolog\Logger::getLevelName(): Argument #1 ($level) must be of type Monolog\Level|int, Symfony\Bridge\Monolog\Handler\ConsoleHandler given, called in /app/vendor/monolog/monolog/src/Monolog/Logger.php on line 196 and defined in /app/vendor/monolog/monolog/src/Monolog/Logger.php:437
Stack trace:
#0 /app/vendor/monolog/monolog/src/Monolog/Logger.php(196): Monolog\Logger::getLevelName()
#1 /app/var/cache/prod/ContainerOqglp2q/App_KernelProdContainer.php(1441): Monolog\Logger->pushHandler()
#2 /app/var/cache/prod/ContainerOqglp2q/App_KernelProdContainer.php(1103): ContainerOqglp2q\App_KernelProdContainer->getMonolog_Logger_RequestService()
#3 /app/vendor/symfony/dependency-injection/Container.php(218): ContainerOqglp2q\App_KernelProdContainer->getHttpKernelService()
#4 /app/vendor/symfony/dependency-injection/Container.php(198): Symfony\Component\DependencyInjection\Container->make()
#5 /app/vendor/symfony/http-kernel/Kernel.php(195): Symfony\Compone" while reading response header from upstream, client: 172.27.0.16, server: _, request: "POST /job-engine-client/execute HTTP/1.0", upstream: "fastcgi://192.168.64.5:9000", host: "x"
I have not been able to reproduce the error manually, as it only happens in my staging environment, and very inconsistent.
It is currently only visible in HTTP requests triggered by a cronjob every 5 minutes. In the past 4 days, it only happened 2 times.
The application is deployed using docker compose, with a custom Ubuntu Dockerfile.
The application is deployed to multiple hosts, and shows the same random occurence of errors on each host.
When looking at the Monolog Logger.php file, it is really hard to understand how the stack trace that is logged can be ever triggered.
I'm suspecting some kind of PHP opcache or JIT issue, or perhaps an issue with the docker filesystem returning some other cached (older) versions of files.
Has anyone seen similar errors, or perhaps other suggestions how to debug & resolve this issue?

Slow Responses & Errors hosting Laravel API on Heroku

I am having an odd experience with Heroku hosting my Laravel app/API
Locally everything looks good but recently requests are slow or timing out.
I still get results (most of the time) but the logs show the below;
2021-04-07T14:07:08.267681+00:00 app[web.1]: [07-Apr-2021 14:07:08] WARNING: [pool www] child 145, script '/app/public/index.php' (request: "GET /index.php") executing too slow (3.062416 sec), logging
2021-04-07T14:07:08.268185+00:00 app[web.1]:
2021-04-07T14:07:08.268269+00:00 app[web.1]: [07-Apr-2021 14:07:08] [pool www] pid 145
2021-04-07T14:07:08.268346+00:00 app[web.1]: script_filename = /app/public/index.php
2021-04-07T14:07:08.268538+00:00 app[web.1]: [0x00007f4cb9618040] execute() /app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:112
2021-04-07T14:07:08.268729+00:00 app[web.1]: [0x00007f4cb9617fc0] execute() /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php:343
2021-04-07T14:07:08.269002+00:00 app[web.1]: [0x00007f4cb9617f20] Illuminate\Database\{closure}() /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php:671
2021-04-07T14:07:08.269207+00:00 app[web.1]: [0x00007f4cb9617e60] runQueryCallback() /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php:638
2021-04-07T14:07:08.269390+00:00 app[web.1]: [0x00007f4cb9617da0] run() /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php:346
2021-04-07T14:07:08.269589+00:00 app[web.1]: [0x00007f4cb9617d10] select() /app/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2313
2021-04-07T14:07:08.269788+00:00 app[web.1]: [0x00007f4cb9617ca0] runSelect() /app/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2301
2021-04-07T14:07:08.270038+00:00 app[web.1]: [0x00007f4cb9617bd0] Illuminate\Database\Query\{closure}() /app/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2796
2021-04-07T14:07:08.270249+00:00 app[web.1]: [0x00007f4cb9617b30] onceWithColumns() /app/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2302
2021-04-07T14:07:08.270443+00:00 app[web.1]: [0x00007f4cb9617a50] get() /app/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:588
2021-04-07T14:07:08.270650+00:00 app[web.1]: [0x00007f4cb9617920] getModels() /app/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:572
2021-04-07T14:07:08.270837+00:00 app[web.1]: [0x00007f4cb9617820] get() /app/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:477
2021-04-07T14:07:08.270978+00:00 app[web.1]: [0x00007f4cb96177a0] all() /app/vendor/tcg/voyager/routes/voyager.php:39
2021-04-07T14:07:08.271163+00:00 app[web.1]: [0x00007f4cb96176d0] {closure}() /app/vendor/laravel/framework/src/Illuminate/Routing/Router.php:423
2021-04-07T14:07:08.271362+00:00 app[web.1]: [0x00007f4cb9617650] loadRoutes() /app/vendor/laravel/framework/src/Illuminate/Routing/Router.php:382
2021-04-07T14:07:08.271552+00:00 app[web.1]: [0x00007f4cb96175b0] group() /app/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:261
2021-04-07T14:07:08.271709+00:00 app[web.1]: [0x00007f4cb9617500] __callStatic() /app/vendor/tcg/voyager/routes/voyager.php:133
2021-04-07T14:07:08.271894+00:00 app[web.1]: [0x00007f4cb9617470] {closure}() /app/vendor/laravel/framework/src/Illuminate/Routing/Router.php:423
2021-04-07T14:07:08.272080+00:00 app[web.1]: [0x00007f4cb96173f0] loadRoutes() /app/vendor/laravel/framework/src/Illuminate/Routing/Router.php:382
2021-04-07T14:07:08.272276+00:00 app[web.1]: [0x00007f4cb9617350] group() /app/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:261
2021-04-07T14:07:09.811958+00:00 app[web.1]: 99.99.99.99 - - [07/Apr/2021:14:07:05 +0000] "GET /api/v1/mentors HTTP/1.1" 200 7278 "-" "PostmanRuntime/7.26.10
2021-04-07T14:07:09.819006+00:00 heroku[router]: at=info method=GET path="/api/v1/mentors" host=xxxxxxxxxxxxxx.herokuapp.com request_id=17d1f729-e3a2-41dc-8c92-f0b917623b74 fwd="999.999.999.99" dyno=web.1 connect=1ms service=4615ms status=200 bytes=7586 protocol=https
But the other times things are snappy and I just get these types of logs on a 1-2 response time;
2021-04-07T14:15:37.182510+00:00 app[web.1]: 99.99.99.99 - - [07/Apr/2021:14:15:36 +0000] "GET /api/v1/mentors HTTP/1.1" 200 7278 "-" "PostmanRuntime/7.26.10
2021-04-07T14:15:37.183580+00:00 heroku[router]: at=info method=GET path="/api/v1/mentors" host=xxxxxxxxxxxxxxxxxxx.herokuapp.com request_id=0b8ccc3f-8e3f-44bf-91c0-71ef6d245ad2 fwd="999.999.999.999" dyno=web.1 connect=0ms service=300ms status=200 bytes=7586 protocol=https
2021-04-07T14:15:47.637135+00:00 app[web.1]: 99.99.99.99 - - [07/Apr/2021:14:15:47 +0000] "GET /api/v1/mentors HTTP/1.1" 200 7278 "-" "PostmanRuntime/7.26.10
2021-04-07T14:15:47.638294+00:00 heroku[router]: at=info method=GET path="/api/v1/mentors" host=xxxxxxxxxxxxxxxxxxx.herokuapp.com request_id=8b415575-eb68-4fd4-87df-bca90f5fbf26 fwd="999.999.999.999" dyno=web.1 connect=0ms service=454ms status=200 bytes=7586 protocol=https
2021-04-07T14:15:51.658485+00:00 heroku[router]: at=info method=GET path="/api/v1/mentors" host=xxxxxxxxxxxxxxxxxxx.herokuapp.com request_id=c91c02d4-5141-4002-81aa-05507c0ea3f9 fwd="999.999.999.999" dyno=web.1 connect=1ms service=729ms status=200 bytes=7586 protocol=https
2021-04-07T14:15:51.655872+00:00 app[web.1]: 99.99.99.99 - - [07/Apr/2021:14:15:50 +0000] "GET /api/v1/mentors HTTP/1.1" 200 7278 "-" "PostmanRuntime/7.26.10
I thought it might be some queries with a number of relationships defined but even basic lookups on a single table is giving the same varied responses.
I also looked at the configureRateLimiting value and increased that from 60 to 10000 but nothing seems to change.
Anybody experienced similar? any ideas where to start to troubleshoot this weirdness?
Chris
I'm also having the same issue. However, this issue only occurs when requesting to the website the first time after I deploy changes to heroku. Subsequent requests after that are okay.
When slow execution is detected, function calls or scripts are logged. In your case the app starts to get slow when it reaches database connection part. Quoting from your log:
execute() /app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:112
execute() /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php:343
...
Perhaps you are trying to connect to a remote database? (other database provider aside from heroku). You can try installing composer package barryvdh/laravel-debugbar in your development environment to see how many queries you call, if there are any duplicates and how long does the queries took before loading the page.
Here is the logs on my end:
2021-11-18T06:46:17.662199+00:00 app[api]: Release v523 created by user bk2o1.syndicates#gmail.com
2021-11-18T06:46:18.304816+00:00 heroku[web.1]: State changed from down to starting
2021-11-18T06:46:18.355707+00:00 heroku[worker.1]: State changed from down to starting
2021-11-18T06:46:25.941551+00:00 heroku[worker.1]: Starting process with command `php artisan queue:work`
2021-11-18T06:46:26.562345+00:00 heroku[worker.1]: State changed from starting to up
2021-11-18T06:46:28.137180+00:00 heroku[web.1]: Starting process with command `vendor/bin/heroku-php-apache2 public/`
2021-11-18T06:46:30.999737+00:00 app[web.1]: DOCUMENT_ROOT changed to 'public/'
2021-11-18T06:46:31.213248+00:00 app[web.1]: Detected 536870912 Bytes of RAM
2021-11-18T06:46:31.279814+00:00 app[web.1]: PHP memory_limit is 128M Bytes
2021-11-18T06:46:31.279869+00:00 app[web.1]: Starting php-fpm with 4 workers...
2021-11-18T06:46:31.354604+00:00 app[web.1]: Starting httpd...
2021-11-18T06:46:31.868967+00:00 heroku[web.1]: State changed from starting to up
2021-11-18T06:46:59.375247+00:00 app[web.1]: [18-Nov-2021 06:46:59] WARNING: [pool www] child 146, script '/app/public/index.php' (request: "GET /index.php") executing too slow (3.248194 sec), logging
2021-11-18T06:46:59.375717+00:00 app[web.1]:
2021-11-18T06:46:59.375797+00:00 app[web.1]: [18-Nov-2021 06:46:59] [pool www] pid 146
2021-11-18T06:46:59.375873+00:00 app[web.1]: script_filename = /app/public/index.php
2021-11-18T06:46:59.376056+00:00 app[web.1]: [0x00007f6d6dc1b4a0] curl_multi_select() /app/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php:160
2021-11-18T06:46:59.376216+00:00 app[web.1]: [0x00007f6d6dc1b3f0] tick() /app/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php:183
2021-11-18T06:46:59.376355+00:00 app[web.1]: [0x00007f6d6dc1b370] execute() /app/vendor/guzzlehttp/promises/src/Promise.php:248
2021-11-18T06:46:59.376501+00:00 app[web.1]: [0x00007f6d6dc1b2d0] invokeWaitFn() /app/vendor/guzzlehttp/promises/src/Promise.php:224
2021-11-18T06:46:59.376648+00:00 app[web.1]: [0x00007f6d6dc1b250] waitIfPending() /app/vendor/guzzlehttp/promises/src/Promise.php:269
2021-11-18T06:46:59.376797+00:00 app[web.1]: [0x00007f6d6dc1b1c0] invokeWaitList() /app/vendor/guzzlehttp/promises/src/Promise.php:226
2021-11-18T06:46:59.376940+00:00 app[web.1]: [0x00007f6d6dc1b140] waitIfPending() /app/vendor/guzzlehttp/promises/src/Promise.php:62
2021-11-18T06:46:59.377110+00:00 app[web.1]: [0x00007f6d6dc1b0b0] wait() /app/vendor/microsoft/azure-storage-blob/src/Blob/BlobRestProxy.php:3018
2021-11-18T06:46:59.377313+00:00 app[web.1]: [0x00007f6d6dc1b020] getBlobProperties() /app/vendor/league/flysystem-azure-blob-storage/src/AzureBlobStorageAdapter.php:240
2021-11-18T06:46:59.377510+00:00 app[web.1]: [0x00007f6d6dc1aef0] getMetadata() /app/vendor/league/flysystem-azure-blob-storage/src/AzureBlobStorageAdapter.php:153
2021-11-18T06:46:59.377670+00:00 app[web.1]: [0x00007f6d6dc1ae80] has() /app/vendor/league/flysystem-cached-adapter/src/CachedAdapter.php:212
2021-11-18T06:46:59.377801+00:00 app[web.1]: [0x00007f6d6dc1add0] has() /app/vendor/league/flysystem/src/Filesystem.php:58
2021-11-18T06:46:59.377981+00:00 app[web.1]: [0x00007f6d6dc1ad50] has() /app/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php:110
2021-11-18T06:46:59.378080+00:00 app[web.1]: [0x00007f6d6dc1ace0] exists() /app/app/Models/Image.php:39
2021-11-18T06:46:59.378317+00:00 app[web.1]: [0x00007f6d6dc1ac20] getOriginalUrlAttribute() /app/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php:527
2021-11-18T06:46:59.378532+00:00 app[web.1]: [0x00007f6d6dc1ab90] mutateAttribute() /app/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php:541
2021-11-18T06:46:59.378762+00:00 app[web.1]: [0x00007f6d6dc1ab00] mutateAttributeForArray() /app/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php:163
2021-11-18T06:46:59.378960+00:00 app[web.1]: [0x00007f6d6dc1aa60] attributesToArray() /app/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1403
2021-11-18T06:46:59.379155+00:00 app[web.1]: [0x00007f6d6dc1a990] toArray() /app/vendor/laravel/framework/src/Illuminate/Collections/Traits/EnumeratesValues.php:828
2021-11-18T06:46:59.379373+00:00 app[web.1]: [0x00007f6d6dc1a910] Illuminate\Support\Traits\{closure}() /app/vendor/laravel/framework/src/Illuminate/Collections/Collection.php:642
2021-11-18T06:47:26.126488+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/" host=my-website-url-obviously.herokuapp.com request_id=825cada4-f0e1-4019-9edf-963bb47c995c fwd="112.200.130.157" dyno=web.1 connect=0ms service=30000ms status=503 bytes=0 protocol=https
2021-11-18T06:47:26.420440+00:00 app[web.1]: [18-Nov-2021 06:47:26] WARNING: [pool www] child 146, script '/app/public/index.php' (request: "GET /index.php") execution timed out (30.290064 sec), terminating
2021-11-18T06:47:26.983257+00:00 app[web.1]: 10.1.16.72 - - [18/Nov/2021:06:46:56 +0000] "GET / HTTP/1.1" 200 20063 "https://dashboard.heroku.com/" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36 Edg/95.0.1020.44
Which consists of calls using guzzle since I was fetching images from Azure:
getBlobProperties() /app/vendor/league/flysystem-azure-blob-storage/src/AzureBlobStorageAdapter.php:240
exists() /app/app/Models/Image.php:39
And on my App\Models\Image line 39, I was checking if image exists before actually fetching it. The issue came up when I eager loaded 62 images:
// in App\Models\Image.php
if(Storage::disk($this->disk)->exists($path.'/'.$filename)) {
// fetch the thing here
}
Solved by avoiding the check and just returning a generated url using storage facade
// in App\Models\Image.php
return Storage::disk($this->disk)->url($path.'/'.$filename).'?'.$this->updated_at?->format('U');
Another thing to consider is how much traffic your app is receiving when things started going slow. Data being displayed on page dynamically can really take up huge amount of memory depending on how much data is kept on memory during runtime and how many visitors are requesting for data (note: EVEN IF THE DATA IS CACHED). From my experience I also noticed sudden slow response times when bots are visiting the app.
This is not really a way to solve your issue but more of an overview of what might be going on under the hood. And most importantly the logs gives us a hint to what is happening and you can go from there.

Joomla 3.8 deploy to Heroku HTTP 500 error

I'm currently trying to deploy a new Joomla installation to Heroku.
I transferred all the files from the Joomla ZIP to the Git repo linked to my Heroku project, and I'm not encountering a HTTP 500 error when opening the website.
In the Heroku logs I can see the following errors pop up:
2018-03-27T09:17:48.900244+00:00 heroku[router]: at=info method=GET
path="/" host=pacific-badlands-52973.herokuapp.com request_id=71491c3a- 62df-4054-b015-02d01bd8a073 fwd="94.143.189.241" dyno=web.1 connect=0ms service=8ms status=500 bytes=169 protocol=https
2018-03-27T09:17:48.899418+00:00 app[web.1]: [27-Mar-2018 09:17:48 UTC] PHP Warning: require(/app/libraries/vendor/autoload.php): failed to open stream: No such file or directory in /app/libraries/cms.php on line 36
2018-03-27T09:17:48.899730+00:00 app[web.1]: [27-Mar-2018 09:17:48 UTC] PHP Fatal error: require(): Failed opening required '/app/libraries/vendor/autoload.php' (include_path='.:/app/.heroku/php/lib/php') in /app/libraries/cms.php on line 36
I looked at the structure of the download files and folders from Joomla, and the required file which is throwing the error is in my repository, so I don't understand why it would throw this error? See screenshot below for the structure of my files.
Any suggestions what to do?

502 gateway errors with nginx php-fpm and wordpress site

i have problems with one of 2 websites running on a centos server through NGINX + PHP-FPM.
For one of the websites running WordPress WooCommerce and a couple of plugins it feels like randomly getting 502 timeouts.
Especially on accessing category/archive or single product pages.
CPU and memory load is ok, also no errors or warnings here
What i can see from the logs is the following
/var/log/php-fpm/error.log
[27-Nov-2017 11:58:16] NOTICE: finished trace of 719
[27-Nov-2017 11:58:36] WARNING: [pool www] child 703, script '/srv/www/domain.com/public_htm/index.php' (request: "GET /index.php") executing too slow (15.478662 sec$
[27-Nov-2017 11:58:36] NOTICE: child 703 stopped for tracing
[27-Nov-2017 11:58:36] NOTICE: about to trace 703
[27-Nov-2017 11:58:36] NOTICE: finished trace of 703
/var/log/nginx/domain-error.log
[error] 30981#0: *18683 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 162.158.89.37, server: www.kixl.de, request: "GET /sneaker/asics HTTP/1.1", upstream: "fastcgi://127.0.0.1:9001",
thats pretty much it. Sometimes pages are reachable again, otherwise i have to restart php-fpm.
I would really like to find out the real reason behind these timeouts but donĀ“t know where to look.
I already tried changing debug levels for NGINX and PHP-FPM to debug and more without getting more details what exactly causing the trouble.
I depend on the plugins and theme activated for this wordpress install so deactivating or using default theme is no option here.
Maybe someone can tell me how to find out what File, Plugin or maybe some database query causing PHP-FPM to hang, leading in the web server to timeout.

505 Error Heroku Deploying Personal Website

I'm trying to host my personal website on heroku. My website only has html, css, and javascript files, and I read that heroku only deploys apps written in ruby, node, scala, php, etc. So, I followed this tutorial (http://www.lemiffe.com/how-to-deploy-a-static-page-to-heroku-the-easy-way/) and changed my index.html file to home.html and included an index.php file that has the following code: <?php include_once("home.html"); ?>.
I've successfully pushed it to heroku, but when I open the heroku url of my app, it gives me a 505 error.
Below is my heroku log:
2015-11-14T02:42:05.497208+00:00 heroku[api]: Deploy 63ae6bd by email#gmail.com
2015-11-14T02:42:05.497305+00:00 heroku[api]: Release v4 created by email#gmail.com
2015-11-14T02:42:05.651545+00:00 heroku[slug-compiler]: Slug compilation started
2015-11-14T02:42:05.651555+00:00 heroku[slug-compiler]: Slug compilation finished
2015-11-14T02:42:05.820048+00:00 heroku[web.1]: State changed from up to starting
2015-11-14T02:42:08.998026+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2015-11-14T02:42:09.746422+00:00 heroku[web.1]: Starting process with command `vendor/bin/heroku-php-apache2`
2015-11-14T02:42:09.909064+00:00 app[web.1]: Going down, terminating child processes...
2015-11-14T02:42:10.844965+00:00 heroku[web.1]: Process exited with status 0
2015-11-14T02:42:12.439647+00:00 app[web.1]: Starting php-fpm...
2015-11-14T02:42:12.243079+00:00 app[web.1]: Optimizing defaults for 1X dyno...
2015-11-14T02:42:12.435588+00:00 app[web.1]: 4 processes at 128MB memory limit.
2015-11-14T02:42:14.442033+00:00 app[web.1]: Starting httpd...
2015-11-14T02:42:14.672772+00:00 heroku[web.1]: State changed from starting to up
2015-11-14T02:44:38.663711+00:00 heroku[router]: at=info method=GET path="/" host=mywebsite.herokuapp.com request_id=45aae2bd-a6f8-4023-86cf-6aedd5d23882 fwd="138.110.234.184" dyno=web.1 connect=12ms service=2ms status=500 bytes=224
2015-11-14T02:44:38.663113+00:00 app[web.1]: [14-Nov-2015 02:44:38 UTC] PHP Parse error: syntax error, unexpected '?' in /app/index.php on line 1
2015-11-14T02:44:38.663580+00:00 app[web.1]: 10.146.233.83 - - [14/Nov/2015:02:44:38 +0000] "GET / HTTP/1.1" 500 - "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36
You said 505 error (505 is really quite an exotic error!) but it is actually just a 500 error according to the log you pasted. 500 is the typical server side error, in this case:
PHP Parse error: syntax error, unexpected '?' in /app/index.php on line 1
I'd bet your php file has a space in it or something that isn't quite right. Make sure it looks like what you pasted as instructed here: https://stackoverflow.com/a/17531897/237091
Well , whenever your Web-page's contain HTML, CSS and JavaScript , so follow just 2 steps :
1) Make one file give name as index.html (keep evreything in it) ex:script,stylesheet & body.
2) Now, change these file, copy and paste these same file but change domain to index.php
Then deploy on a Heroku.
Hence this method will help you to deploy your Web-Pages

Categories