0

sorry for this newb question, i just started programming with php

I'm following Yahoo Mail Web Apps PHP tutorial on retrieving mail from Yahoo. the guide is here http://developer.yahoo.com/mail/docs/user_guide/CredentialTheUser.html

on step 3 it says to: In the unzipped directory, run the following command, where can be either json or soap:

$php ListFolders.php

what does it mean by run command? like run command on cmd.exe or somewhere else?

thanks!

Andrey Popov
  • 7,362
  • 4
  • 38
  • 58
01jayss
  • 1,400
  • 6
  • 19
  • 28

1 Answers1

1

Yes, you need to cd (change directory) to your "unzipped directory", and I'll assume you don't have the PHP command available in shell, so you will probably need to supply the entire path.

from cmd.exe,

/path/to/your/php.exe ListFolders.php

or if you do not wish to cd to this directory, simply specify the full path

/path/to/your/php.exe /path/to/unzipped/ListFolders.php
John Cartwright
  • 5,109
  • 22
  • 25
  • sorry the code is actually "$php ListFolders.php "... is it the same thing even for this? – 01jayss Feb 18 '11 at 15:59
  • Yes, your request would look something like `php ListFolders.php json ABCD EFGH` where ABCD EFGH are your consumer and secret keys respectively. – John Cartwright Feb 18 '11 at 16:05
  • i tried doing your code above in cmd.exe (/pathto/php.exe /pathto/ListFolders.php JSON ABCD (consumer) EFGH (secret Key)), but it didn't work. Cmd.exe returned: "Could not open input file" and then the location of my file... i looked and no other programs are using the file and that the path to the file is correct... any solutions? – 01jayss Feb 18 '11 at 18:34
  • See my original answer. You either need to cd into the directory with your ListFolders.php file, or specify the full path to it. – John Cartwright Feb 18 '11 at 18:39
  • your solution worked, but when i execute the code i get a fatal error in php.exe: "Fatal Error: Uncaught exception 'Exception' in (path to ListFolders.php):45 Stack trace: #0 {main} thrown in (path to ListFolders.php) on line 45... any solutions to this? thanks! – 01jayss Feb 18 '11 at 20:30
  • It is impossible to debug with that error. Generally the exception will provide a little more information on why the exception is thrown. Although, looking at your exception I see `Exception' in (path to ListFolders.php)` .. notice the path to ListFolders.php, that certainly can't be right. P.S., don't forget to upvote if you find my suggestions useful (I only mention since you are new here). – John Cartwright Feb 18 '11 at 20:42
  • sorry, I just subbed in the actual path to ListFolders.php (C:\xampp\xampp\htdocs\Dropbox\Testing\Yahoo Mail\phpsample\ListFolders.php) with "path to ListFolders.php"... – 01jayss Feb 18 '11 at 21:10
  • also line 44-46 in the code is this...if (!$oauth_token || !$oauth_token_secret) { throw new Exception($resp); }... line 45 is the "throw new Exception($resp);" part – 01jayss Feb 18 '11 at 21:16
  • It appears you are not passing the parameters correctly. Please copy + paste the command you are using. It should look something like: `php ListFolders.php json SOME_KEY SOME_OTHER_KEY` – John Cartwright Feb 18 '11 at 21:18
  • command: C:\XAMPP\xampp\htdocs\Dropbox\Testing\Yahoo Mail\phpsample>C:\xampp\xampp\php\php.exe ListFolders.php json ...the command prompt returns: Fatal error: Uncaught exception 'Exception' in C:\XAMPP\xampp\htdocs\Dropbox\Testing\Yahoo Mail\phpsample\ListFolders.php:45 Stack trace: #0 {main} thrown in C:\XAMPP\xampp\htdocs\Dropbox\Testing\Yahoo Mail\phpsample\ListFolders.php on line 45 – 01jayss Feb 18 '11 at 21:25
  • Assuming you are inputting the parameters correctly, it should be working. It is impossible for me to debug unless I can see how $oauth_token_secret and $oauth_token are are defined. However, I can only spend so much time helping you with this.. I am at work and no upvotes makes me sad ;) – John Cartwright Feb 18 '11 at 21:31
  • Lol i can't upvote... needs 15 reputation i've only got 3, sorry :D – 01jayss Feb 18 '11 at 21:34
  • Very well, don't worry about the upvotes. Can you show where those two variables are defined? If you add `print_r($argv); exit();` to the top of the script, what is returned? – John Cartwright Feb 18 '11 at 21:40
  • I can send u the files if u want and you could take alook at them for me :p... i got them from the Yahoo Developer Network site here: http://developer.yahoo.com/mail/docs/user_guide/examples/phpsample.zip.. be sure to unzip all of the files because they are interrelated i believe... the user guide for this is here: http://developer.yahoo.com/mail/docs/user_guide/index.html... also the print_r returns nothing, and two variables, if my newb programming skills r rite :D are defined in another file called OAuth.php (Oauth.php has been "include" in ListFolders.php...thanks!!!!! – 01jayss Feb 18 '11 at 21:50
  • did u get a chance to debug it yet? – 01jayss Feb 19 '11 at 21:42
  • No, but I will first thing Tuesday morning (Monday is a holiday) – John Cartwright Feb 20 '11 at 00:30