php-general Digest 7 Jul 2013 15:09:47 -0000 Issue 8288

Topics (messages 321566 through 321574):

Re: mongo usage
        321566 by: Tim Dunphy
        321570 by: Matijn Woudt
        321571 by: Tim Dunphy
        321572 by: Tim Streater
        321573 by: Tim Dunphy

Re: Guaranteed Way to Get Error Message Wanted
        321567 by: Richard Quadling
        321568 by: Brian Smither
        321569 by: Richard Quadling

phpdocumentor with PHP5.4
        321574 by: Lester Caine

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
| You commented out the setting of yhe addresses variable

Those were both equivalent ways of stating the same thing. I tried
substituting the other statement but there was no change:

    $db = $connection->jfdb;

    //$collection = $db->addresses;

    $adresses = $connection->jfdb->adresses;

Thanks again!



On Sat, Jul 6, 2013 at 2:57 PM, Jonathan Sundquist <jsundqu...@gmail.com>wrote:

> You commented out the setting of yhe addresses variable
> On Jul 6, 2013 1:42 PM, "Tim Dunphy" <bluethu...@gmail.com> wrote:
>
>> Hey all,
>>
>>  I'm trying to pick up some basic use of MongoDB using PHP.
>>
>>  I seem to have hit an early obstacle that I'd like your opinion on. I try
>> to pass an array to the mongo insert function, but for some reason the
>> function does not recognize the array I'm passing. Even though I can
>> perform a var_dump() on the array and see the contents.
>>
>> Here's the output I'm seeing (with error):
>>
>> Mongo Test Page array(6) { ["first_name"]=> string(5) "Peter"
>> ["last_name"]=> string(6) "Parker" ["address"]=> string(16) "175 Fifth
>> Avenue" ["city"]=> string(8) "New York" ["state"]=> string(2) "NY"
>> ["zip"]=> string(5) "10010" }
>>
>> *Notice*: Undefined variable: addresses in
>> */var/www/mongomaven/index.php* on
>> line *36*
>>
>> *Fatal error*: Call to a member function insert() on a non-object in *
>> /var/www/mongomaven/index.php* on line *36*
>> *
>> *
>> And here's the code:
>>
>> <html>
>>  <head>
>>   <title>Mongo Test</title>
>>  </head>
>>  <body>
>>
>>  Mongo Test Page
>>  <?php
>>
>>
>>
>>     $connection = new Mongo();
>>
>>
>>     $db = $connection->jfdb;
>>
>>     $collection = $db->addresses;
>>
>>     //$adresses = $connection->jfdb->adresses;
>>
>>     $address = array(
>>      'first_name' => 'Peter',
>>     'last_name' => 'Parker',
>>     'address' => '175 Fifth Avenue',
>>     'city' => 'New York',
>>     'state' => 'NY',
>>     'zip' => '10010',    );
>>
>>     var_dump($address);
>>
>>     echo '<br />';
>>
>>    $addresses->insert($address);
>>
>>  ?>
>>  </body>
>> </html>
>>
>>
>> I'd appreciate any advice you might have.
>>
>> Thanks,
>> Tim
>>
>> --
>> GPG me!!
>>
>> gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B
>>
>


-- 
GPG me!!

gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B

--- End Message ---
--- Begin Message ---
On Sat, Jul 6, 2013 at 9:16 PM, Tim Dunphy <bluethu...@gmail.com> wrote:

> | You commented out the setting of yhe addresses variable
>
> Those were both equivalent ways of stating the same thing. I tried
> substituting the other statement but there was no change:
>
>     $db = $connection->jfdb;
>
>     //$collection = $db->addresses;
>
>     $adresses = $connection->jfdb->adresses;
>
> Thanks again!
>
>
You seem to spell the variable differently (1 'd' vs. 2 'd's)?

- Matijn

--- End Message ---
--- Begin Message ---
| You seem to spell the variable differently (1 'd' vs. 2 'd's)?

Thanks! Fixed the type-o. Still no change.

   $connection = new Mongo();


    $db = $connection->jfdb;

    //$collection = $db->addresses;

    $adresses = $connection->jfdb->addresses;

Any other suggestions? Appreciated.

Tim


On Sat, Jul 6, 2013 at 5:39 PM, Matijn Woudt <tijn...@gmail.com> wrote:

>
>
>
> On Sat, Jul 6, 2013 at 9:16 PM, Tim Dunphy <bluethu...@gmail.com> wrote:
>
>> | You commented out the setting of yhe addresses variable
>>
>> Those were both equivalent ways of stating the same thing. I tried
>> substituting the other statement but there was no change:
>>
>>     $db = $connection->jfdb;
>>
>>     //$collection = $db->addresses;
>>
>>     $adresses = $connection->jfdb->adresses;
>>
>> Thanks again!
>>
>>
> You seem to spell the variable differently (1 'd' vs. 2 'd's)?
>
> - Matijn
>



-- 
GPG me!!

gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B

--- End Message ---
--- Begin Message ---
On 06 Jul 2013 at 23:27, Tim Dunphy <bluethu...@gmail.com> wrote: 

> | You seem to spell the variable differently (1 'd' vs. 2 'd's)?
>
> Thanks! Fixed the type-o. Still no change.
>
>   $connection = new Mongo();
>
>    $db = $connection->jfdb;
>
>    //$collection = $db->addresses;
>
>    $adresses = $connection->jfdb->addresses;

     ~~~~~~~~~

>
> Any other suggestions? Appreciated.

Fix the other typo.

--
Cheers  --  Tim

--- End Message ---
--- Begin Message ---
Thanks. Sorry to bug you guys with this. That did it. sigh


On Sat, Jul 6, 2013 at 6:49 PM, Tim Streater <t...@clothears.org.uk> wrote:

> On 06 Jul 2013 at 23:27, Tim Dunphy <bluethu...@gmail.com> wrote:
>
> > | You seem to spell the variable differently (1 'd' vs. 2 'd's)?
> >
> > Thanks! Fixed the type-o. Still no change.
> >
> >   $connection = new Mongo();
> >
> >    $db = $connection->jfdb;
> >
> >    //$collection = $db->addresses;
> >
> >    $adresses = $connection->jfdb->addresses;
>
>      ~~~~~~~~~
>
> >
> > Any other suggestions? Appreciated.
>
> Fix the other typo.
>
> --
> Cheers  --  Tim
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



-- 
GPG me!!

gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B

--- End Message ---
--- Begin Message ---
On 6 July 2013 19:50, Brian Smither <bhsmit...@gmail.com> wrote:

> >It looks like you are running the thread-safe version with
> >FastCGI, which I understand to be counter to the recommendations.
>
> Thank you for the comment.
>
> I switched to PHP5.4.17-NTS-VC9, but the application still crashes. And
> still no clue as to why.
>
> So, still looking for that magic method to get PHP to report what's
> happening on a 500 Internal Server Error when it's (presumably? not
> sure...) not the server's fault.


Have you got all your extensions updated? Enable display_startup_errors.
Try running the command line PHP ...

php -r "echo 1;"

With your config. Just to see if there is anything ultra obvious missing.

-- 
Richard Quadling
Twitter : @RQuadling

--- End Message ---
--- Begin Message ---
>Have you got all your extensions updated?

I would think so. Just to state the required disclaimers:
phpinfo.php with <? phpinfo() ?> works.
Liberally peppering a tracer routine throughout the application shows it is 
getting executed up until one spot. But there is nothing obviously wrong with 
the code. Nothing!

That's why I need the guaranteed message delivery on why PHP does not like the 
code.




--- End Message ---
--- Begin Message ---
On 6 July 2013 21:45, Brian Smither <bhsmit...@gmail.com> wrote:

> >Have you got all your extensions updated?
>
> I would think so. Just to state the required disclaimers:
> phpinfo.php with <? phpinfo() ?> works.
> Liberally peppering a tracer routine throughout the application shows it
> is getting executed up until one spot. But there is nothing obviously wrong
> with the code. Nothing!
>
> That's why I need the guaranteed message delivery on why PHP does not like
> the code.
>
>
Turn on all your error reporting/logging. Add a try/catch if appropriate.
Turn off any unhandled exception processing.

Load in XDebug and get a trace going, what is the code doing prior to
failure?


-- 
Richard Quadling
Twitter : @RQuadling

--- End Message ---
--- Begin Message ---
Anybody have phpdocumentor running with PHP5.4?
I'm convinced that the errors my copy is throwing are due to e_strict, but I've confirmed that I have the right ini file ( all the needed extensions load ) and I'm getting error_reporting showing 22527 with e_strict off and 24575 with e_strict on - so at least it is changing the setting?

Once again I'm wasting hours getting something which I have had running fine on the older servers to actually work in a new setup. In this case phpdocumentor seems to suggesting *IT* needs PHP5.3 but the main script also switched e_strict off anyway, so 5.4 should work as well?

--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

--- End Message ---

Reply via email to