0

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.

Craig Ringer
  • 307,061
  • 76
  • 688
  • 778
toy
  • 422
  • 1
  • 7
  • 19
  • yes: Fatal error: Call to undefined function pg_connect() as expected – toy Aug 18 '12 at 00:59
  • PHP error reporting doesn't affect PostgreSQL, nor does it affect the ability to load PostgreSQL. Q: Are there any errors in your PHP and/or PG error logs? Windows event logs? – paulsm4 Aug 18 '12 at 01:00
  • @paulsm: no but his directives are not valid, there for the pg directives never take hold. – prodigitalson Aug 18 '12 at 01:02
  • "Her" directives :) In principle, I agree. But she seems to have inherited that ":" (instead of "=") syntax, so who knows - maybe it works. COMPROMISE: go back to the "original" php.ini, see if the pg extension is loaded, and take it from there? – paulsm4 Aug 18 '12 at 01:06
  • hey paul or prodig: it would really help if you can give me example of valid directives instead of just telling me im wrong... i know im wrong! thats why im here! btw im now using: display_errors= On and error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT which is now not showing errs – toy Aug 18 '12 at 01:08

1 Answers1

2

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.
prodigitalson
  • 60,050
  • 10
  • 100
  • 114
  • yes thanks pro - however errs are not showing up, ie i put in a junk line like "require 'anonexistentfile.php';" which should throw an err but it just fails the script with no err – toy Aug 18 '12 at 01:14
  • you also need to turn on `display_errors` otherwise they just go to the error log. Also make sure you are editing the correct php.ini and that nothing in your code is turning them off at runtime with `ini_set()` or `error_reporting()` – prodigitalson Aug 18 '12 at 01:18
  • hey pro - thanks - yes i did (i updated my orig post) and at your sugg i just checked my err log and they dont even show up there! – toy Aug 18 '12 at 01:22
  • Are you sure they only appear once? its possible you set the value on one spot but then its being overriden by the value being set again - also does pg work now? – prodigitalson Aug 18 '12 at 01:24
  • hey pro - thanks for sticking this thru with me - i pulled on pauls sugg and reloaded a fresh copy of php.ini and it worked - im a/b'ing the two files now and see the diffs thanks! – toy Aug 18 '12 at 01:37
  • And whats the verdict - did you get it working or still no errors? – prodigitalson Aug 18 '12 at 01:38
  • fyi - yes later on someone had added this: display_errors = Off arggghhh!! thanks everythings on course now – toy Aug 18 '12 at 01:40