I have a PHP app on Heroku that keeps giving an Application Error randomly, and the logs don't say anything at all. I can't be sure but it seems that the error comes when 6-8 concurrent users hit the app. To figure this out, I thought of installing the New Relic Add On, and I have been trying to follow the document here - https://rpm.newrelic.com/accounts/343400/applications/setup.
Please excuse my limited knowledge, but it seems that the instructions given here are supposed to be run on an actual server ? How can I run them for my Heroku server ? I use a windows machine. I have installed wget for windows, but then apt, deb ?
There are other discussions about this where people have mentioned that new relic is not supported on Heroku, but those are at least an year old. And Heroku is providing New Relic as an Add On.
Can anyone please help...
As of September 2014, New Relic PHP does support running on Heroku using the official Heroku PHP buildpack.
See:
New Relic documentation
Heroku documentation
New Relic does not officially support our PHP agent on Heroku. Here's the current list of supported languages:
https://devcenter.heroku.com/articles/newrelic#supported-languages-and-frameworks
The setup requires the installation of a PHP extension and a local proxy daemon, which tends to require a bit more access to the app server. If you have any tips, please share them here -- just keep in mind that we cannot support it.
At the moment, PHP on Heroku is unsupported by New Relic. See this SO question for more: Deploying New Relic on Heroku Cedar (PHP)
I can't really give you an answer on this because we are currently in testing phase so we don't have concurrent users yet.
If you are using the official php buildpack from Heroku (if you've never heard of a buildpack you probably are) it's probably best that you ask their support as it might be a bug on their side. If you're using your own buildpack you can find an example of a working Heroku/PHP/Newrelic buildpack here:
https://github.com/iphoting/heroku-buildpack-php-tyler
We haven't experienced the same problem with the above buildpack.
Related
in order to use mPDF on Heroku I need to add mbregex to PHP. Does anybody know how to enable mbregex on Heroku?
When googling it, I'm not able to find any solution. I cannot believe nobody encountered this problem before.
Thank you!
The change was made in this commit to the Heroku PHP Buildpack (which is how you run PHP on Heroku) which prevented mbregex being used in PHP versions 7.4 or later because libonig wasn't available.
Version 172 of the Heroku PHP Buildpack is nearly ready for release and re-enables mbstring regex on PHP 7.4 for 7.4.3. This is scheduled for release today all being well so in all likelihood if you try pushing to heroku tomorrow this will resolve the problem
I'm using a PHP instance within IBM Bluemix.
Now we are posting raw data from about 200 external devices to a PHP instance.
This rawdata is small (1 or 2 KB), but it sends every 4 to 5 seconds.
If I'm using the standard PHP buildpack, I see that the webpage sometimes won't respond. (It looks like it is waiting for a free client connection.)
Could anybody tell me which PHP buildpack is the best buildpack for using in PHP instance?
The PHP instance within IBM Bluemix is the opensource cloudfoundry php-buildpack buildpack. You can try the current version of the buildpack to see if your issue is resolved. For example if you would like to use the latest version you can push your app with:
cf push yourAppName -b https://github.com/cloudfoundry/php-buildpack.git
If you need further help please include code examples, logs and anything else that can help with debugging your issue.
Assuming that the problem is related to the used buildpack, you could take a look at Heroku buildpack: PHP. It uses Composer for dependency management, supports PHP or HHVM (experimental) as runtimes, and offers a choice of Apache2 or Nginx web servers.
You could try this buildpack as an alternative to the default one. I suggest you to test both the web servers to see if you notice different performances with the load spikes.
If the problem persists I think you should do a deeper performance investigation. You could also use one of the services provided by Bluemix in the DevOps catalog.
I need Openshift Online to get the PHP PECL extension V8Js running for letting React.js execute server side Javascript from PHP. Are PECL extensions now enabled? If yes, how can I do that? The last I saw was a feature request for this from 02.2014. But I did not get information if in the meantime something has changed.
25.07.2015: I'm a step further. Corey pointed me to a promising direction. Did not know, that PECL is some kind of PEAR. Both seem compatible to openshift. I added 'v8js' to the .openshift/pear.txt file and when git pushing the app the console talked to me. I tried to install v8js with 'pecl install channel://pecl.php.net/v8js-0.2.0' but the compiler could not find V8, console said:
checking for V8 Javascript Engine... yes, shared
checking for V8 files in default path... not found
configure: error: Please reinstall the v8 distribution
So, how do I find the path to V8, and how do I know, if it is already there? If not there, how do I get it?
26.07.2015: Did not manage to install V8. I tried to do it like described in the Google docs. The compilation takes 600MB! and I am running out of quota. Maybe I may need to upgrade python version too, since the depot_tools require a more recent version. So, this is very complicated right now. I am asking myself, if I am on the right track. I would still prefer the mainstream PHP way with V8Js for serverside Javascript instead of node.js.
What shall I do? another shared hosting (search hard)? Cloud hosting, like bitnami and Amazon AWS? Is there still hope with openshift? Virtual, managed server? I am confused.
Have you tried reading through the section of the Developer Portal about PHP cartridge dependencies? https://developers.openshift.com/en/php-getting-started.html#step3
The Openshift Online support immediately answered my question: "Sorry, we do not have the V8Js PECL extension at this time".
But from the hints of corey112358 and N.B. and own experience and from internet research I additionally learned that it's a hassle to make that extension run or find hosting support, if you are not a Google engineer who can install v8 or if you have no time or money to run an own server or if you are no expert in V8Js. So, in this case, you may find node.js a more comfortable solution.
I'm trying to install NewRelic on my website, I use PHP, cPanel(VPS/dedicated) and Centos (64bit) for my server, I've installed the server monitoring part right on my server but when I try to install the 'app' part on my server I can't get that to install, I followed the instruction links http://newrelic.com/docs/php/new-relic-for-php
but to no success, has anyone got any ideas as to why this maybe? I have restared httpd and appache multiple times and given it some time to propogate etc..
The problem of this is having WHM installed and many PHP services installed, you should try this guide I found:
New Relic for PHP w/cPanel
We have few dedicated servers on HostGator. Few months back we had installed "NewRelic" on our server for monitoring, later we started having issues and here is what HostGator Tech Team said
"While it's possible to configure a cPanel server to use a non-cPanel
PHP version, it's complicated to configure and we will not support it
or set it up. PHP gets compiled from source by cPanel normally and it
should be left this way, as it interacts with a number of other
components on the server in complicated ways, as you found out today.
We recommend completely removing the custom "Newrelic" repository as
well as the packages it installed in order to avoid further
compatibility problems."
and here is what "NewRelic" team said
"I wasn't trying to suggest that Hostgator's assertion was wrong. I
was just trying to figure out which instructions to go over with you."
Make sure to check compatibility before installing it. Installation instruction can be found at http://www.networkredux.com/answers/view/Hosting/Control_Panels/WHM/cPanel/162
New Relic Needs to document this cpanel compatibility better, I know it's my fault for not researching but while using a hostgator dedicated server with cpanel/whm I got new relic up and running. . then my server became a huge mess if improperly configured files and a few days of reading and learning to get it straightened out - I understand my fault entirely but a big ass CPANEL/WHM <- CAREFULL sign might have helped :P
Has anyone succesfully deployed the New Relic addon to a PHP app running on Heroku Cedar stack? I'm running a fairly high traffic Facebook app on a few dynos and can't get it to work.
The best info I can find details a Python deployment: http://newrelic.com/docs/python/python-agent-and-heroku
Thanks!
Heroku has just recently rolled out support for PHP with Cedar and we at New Relic don't know anything more than you do. We'll be talking with Heroku ASAP to get some docs developed which will certainly be on (New Relic's knowledge base), and I'll report back here as well.
Edited to add:
Sorry for the long delay in me checking back in. Unfortunately this is still not possible in a well-supported way, reason being that our php agent requires a standalone daemon to be running in addition to the dyno that is serving your content. While you can find terrible hacks to get you into the space where you could fire up the daemon temporarily, it's not sustainable and won't port to the next dyno that spins up. This means that we can't support you running the agent in this environment.
Edited to add:
As #aaron-heusser mentioned, support is finally official as of a month or so ago: https://github.com/heroku/heroku-buildpack-php
Note: I work at New Relic.
As of September 2014, New Relic PHP does support running on Heroku using the official Heroku PHP buildpack.
See:
New Relic documentation
Heroku documentation