Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7946661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:13:02+00:00 2026-06-04T01:13:02+00:00

I don’t know about PHP scripts. Am a iPhone developer. I want to enable

  • 0

I don’t know about PHP scripts. Am a iPhone developer. I want to enable Apple Push Notification for my iPhone app. Am following tutorial http://www.raywenderlich.com/3525/apple-push-notification-services-tutorial-part-2. Am getting this following error in my push_development.log file while run the push.php file from Terminal,

Terminal command:

unknownc42c032e8297:~ creagx$ cd /Users/creagx/Desktop/PushChatServer
unknownc42c032e8297:PushChatServer creagx$ php push/push.php development

Error message in push_development.log file:

2012-05-14T10:17:14+05:30 Push script started (development mode)
2012-05-14T10:17:14+05:30 Exiting with fatal error: exception 'PDOException' with message 'SQLSTATE[HY000] [2002] No such file or directory' in /Users/gopi/Desktop/PushChatServer/push/push.php:82
Stack trace:
#0 /Users/gopi/Desktop/PushChatServer/push/push.php(82): PDO->__construct('mysql:host=loca...', 'gopipush', 'uH4q9xQGNAuFW...', Array)
#1 /Users/gopi/Desktop/PushChatServer/push/push.php(36): APNS_Push->__construct(Array)
#2 {main}

I want to know what are the values passing through this command?

// Create a connection to the database.
        $this->pdo = new PDO(
            'mysql:host=' . $config['db']['host'] . ';dbname=' . $config['db']['dbname'], 
            $config['db']['username'], 
            $config['db']['password'],
            array());

        writeToLog('PDO Value: ' . $this->pdo);

I tried to print the PDO values in log file using writeToLog('PDO Value: ' . $this->pdo);. Can anyone please tell me how to know the pdo values? Thanks in advance.

EDIT:

// Create a connection to the database.
        $this->pdo = new PDO(
            'mysql:host=' . $config['db']['host'] . ';dbname=' . $config['db']['dbname'], 
            $config['db']['username'], 
            $config['db']['password'],
            array());

        writeToLog('Host: ' . $config['db']['host']);
        writeToLog('DataBase: ' . $config['db']['dbname']);
        writeToLog('Username: ' . $config['db']['username']);
        writeToLog('Password: ' . $config['db']['password']);

Again got the same error message in log file. I think the writeToLog('Host: ' . $config['db'][‘host’]); line won’t compile until the error fix in $this->pdo line. Is it correct? Please help me. Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T01:13:04+00:00Added an answer on June 4, 2026 at 1:13 am

    PDO is a class… you can use var_dump to inspect it’s member variables. var_dump outputs directly, so you can catch it with output buffering as follows:

    ob_start();
    var_dump($this->PDO);
    writeToLog('PDO state: ' . ob_get_contents());
    ob_end_clean();
    

    To be honest, it’s probably just as easy to do:

    writeToLog('Host: ' . $config['db']['host']);
    writeToLog('DB: ' . $config['db']['dbname']);
    writeToLog('username: ' .  $config['db']['password']);
    writeToLog('Password: ' . $config['db']['password']);
    

    This is all assuming that writeToLog is a working function you’ve created. If not, just echo instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I don't have much PHP experience and I want to know how to best
I don't want to know a way to preload images, I found much on
Don't know if I worded the question right, but basically what I want to
Don't know much about running a function on every item in an array, still
Don't know a whole lot about streams. Why does the first version work using
Don't know much about encryption... Say I'm preparing a SAML request to submit to
Don't really know how to formulate the title, but it should be pretty obvious
Don't know how to google for such, but is there a way to query
Don't know why but font is not displaying.Please help. CSS(in css folder): style.css: @font-face
Don't ask me why but I need to do the following: string ClassName =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.