Search code examples
postgresqlerror-handlingphppg

Turning error_reporting on in php.ini kills my pg module


I have a wamp going on and just recently I had to switch from MySQL to PostgreSQL because of a new client.

Here is how my errs was setup in my php.ini:

display_errors
Default Value: On
Development Value: On
Production Value: Off

; display_startup_errors
;   Default Value: Off
;   Development Value: On
;   Production Value: Off

; error_reporting
;   Default Value: E_ALL & ~E_NOTICE
;   Development Value: E_ALL | E_STRICT
;   Production Value: E_ALL & ~E_DEPRECATED

The pg dll was loading up and working great.

Pg was showing up in my phpinfo(); the world was beautiful.

Then i need to turn errs on because I need it for debugging.

Of course I did this:

display_errors
Default Value: On
Development Value: On
Production Value: Off

; display_startup_errors
;   Default Value: Off
;   Development Value: On
;   Production Value: Off

; error_reporting
   Default Value: E_ALL & ~E_NOTICE
   Development Value: E_ALL | E_STRICT
;   Production Value: E_ALL & ~E_DEPRECATED

... but now the pg module wont load and the pg extension doesnt show up in my phpinfo().

WTH?

Any ideas? What's this is about?

UPDATE

So I've corrected my php.ini to look like this:

display_errors= On
;   Default Value: On
;   Development Value: On
;   Production Value: Off

; display_startup_errors
;   Default Value: Off
;   Development Value: On
;   Production Value: Off

error_reporting = E_ALL & ~E_NOTICE
;   Default Value: E_ALL & ~E_NOTICE
;   Development Value: E_ALL | E_STRICT
;   Production Value: E_ALL & ~E_DEPRECATED

pgsql loading but still no love on error reporting.


Solution

  • Ummm it should be:

    error_reporting = E_ALL & ~E_NOTICE
    

    The other things are jsut notes about suggested values for different types of envronments ini is always

    key_name = value

    Those blocks are form the documentation in the file... if you search the file for the directive and step through the results youll find the actual setting later in the file hence the not before that section:

    ;;;;;;;;;;;;;;;;;;;
    ; Quick Reference ;
    ;;;;;;;;;;;;;;;;;;;
    ; The following are all the settings which are different in either the production
    ; or development versions of the INIs with respect to PHP's default behavior.
    ; Please see the actual settings later in the document for more details as to why
    ; we recommend these changes in PHP's behavior.