Jump to content

Learning PHP and MySQL Second Edition question

loooooooper's Photo
Posted Mar 01 2011 10:20 PM
7233 Views

Am using pear in php and mysql programming. I installed an authentication package 'auth_HTTP' to authenticate users to access the database. It worked fine the first time. However, when i installed smarty and configured the 'php.ini' file
it said; Warning: require_once(Auth/HTTP.php) [function.require-once]: failed to open stream: No such file or directory in C:\xampp\htdocs\OReilly\pear\auth_HTTP1.php on line 8

Fatal error: require_once() [function.require]: Failed opening required 'Auth/HTTP.php' (include_path='.;C:\xampp\Smarty\libs') in C:\xampp\htdocs\OReilly\pear\auth_HTTP1.php on line 8

when i included both 'Auth/HTTP.php' and smarty include_path file, Like this;

//include header templates page (for smarty)
require_once('config.php');

//include authentication page
require_once("Auth/HTTP.php");

I need help here pliz

Attached File(s)

  • Attached File  login.php (1.68K)
    Number of downloads: 431
  • Attached File  posts.php (1.61K)
    Number of downloads: 429


Tags:
2 Subscribe


8 Replies

0
  rachel.j's Photo
Posted Mar 17 2011 12:46 PM

Hi,

It looks like your question has already been answered at http://www.phpfreaks...?topic=326218.0.

Let us know if you have any more questions. You can also email booktech@oreilly.com, our book customer support, for help working through the book.

Rachel James
O'Reilly Media
0
  loooooooper's Photo
Posted Mar 17 2011 10:48 PM

Thanks for getting back to me. Am the one who posted that script at http://www.phpfreaks...topic=326218.0. and as it turns out my question wasn't answered cause am still facing the same problem.Is there any other way to run the script cause I copied and pasted the code from the book but am getting an error message.
0
  rachel.j's Photo
Posted Mar 22 2011 12:47 PM

Have you tried downloading the example code from http://examples.orei.../9780596514013/? You mentioned that you copied the code from the book, but some updates have been made to the downloads, so using that might resolve your issue.

If you're still encountering errors, please contact our book technical support group at booktech@oreilly.com and they'll work through this with you.

Regards,

Rachel
0
  loooooooper's Photo
Posted Mar 25 2011 01:07 AM

I have checked out the updates and when i run the updated code, this is the error message i get;
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\OReilly\pear\blog\login1.php:1) in C:\xampp\php\PEAR\Auth\HTTP.php on line 455

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\OReilly\pear\blog\login1.php:1) in C:\xampp\php\PEAR\Auth\HTTP.php on line 456
Access Denied
Help me out, Thanks
 : Apr 21 2011 07:07 AM
Hi Rachel,

I'm having the exact same issue. I got through all the exercises in the book up until Chapter 17, page 341. When I navigate to my login.php I get:

Warning: require(Auth/HTTP.php) [function.require]: failed to open stream: No such file or directory in /Users/lindsay/Sites/PRACTICE/PHP/CH17/[removed]/login.php on line 5


I tried searching for the file 'Auth/HTTP.php' in my filesystem (through the MAC terminal) which is required on this line (i.e. require_once('Auth/HTTP.php');) and it appears as if this file does not exist in the Pear directory. Does it not come with the basic installation?


BTW - My Chapter 9 exercises that use Pear all work so I know it's not my php.ini file configuration.
--
Updated:

I think that this is one step in the right direction:

http://pear.php.net/.../Auth/download/

but in that download, there's no HTTP.php file, so I'm not sure which file replaces HTTP.php.
--
ANSWER:

if you read the documentation for the newest version of Auth (http://pear.php.net/manual/en/package.authentication.auth.intro.php) you only have to change
require_once('Auth/HTTP.php');
TO
require_once('Auth.php');

It appears as if the code "Auth_HTTP" might not work, so I'm going off to research that.

SO RACHEL - the next edition has to update everything about Pear's Authentication plugin.
0
  Nature Sparrow's Photo
Posted Apr 22 2011 12:58 AM

Hello
0
  rachel.j's Photo
Posted Apr 22 2011 06:56 AM

Please email booktech@oreilly.com, they can work through this with you and record what corrections need to be made in future printings and future editions.
0
  Deb_Le's Photo
Posted Sep 05 2012 12:49 AM

I have the same error, I gonna send an email ;)