PHP on OpenShift: how to enable errors and warnings?

I moved my application to OpenShift, and now, for the convenience of its work, I would like to include errors and warnings on the page. I am currently seeing a blank page.

How to enable errors?

In PHP, it is in php.ini

 error_reporting = E_ALL display_errors = 1 
+4
source share
3 answers

On the #openshift IRC channel I was told that this is not currently configurable

(05:06:58 PM) pmorie: ozizka-ntb: it looks like it is provided by a trolley - I do not believe that you can replace your own

and i need to use both

 error_reporting(E_ALL); ini_set('display_errors', 1); 
+7
source

You might want to set APPLICATION_ENV for development.

$ rhc env set APPLICATION_ENV = development

According to https://developers.openshift.com/en/php-getting-started.html ,

In development mode, your application will:

  • Show more detailed browser errors
  • Display startup errors
  • Enable Xdebug PECL Extension
  • Enable APC Status Check
  • Ignore composer.lock file (if applicable)
+3
source

If you cannot access php.ini , then write this over the php page:

 <?php error_reporting(22527); ?> 

All errors and warnings on the page are displayed here.

0
source

Source: https://habr.com/ru/post/1436138/


All Articles