Jump to content

Intergrating smarty and PEAR packages


loooooooper

Recommended Posts

Hello,

Am a newbie using PEAR packages in my coding. I installed smarty on XAMPP recently and followed the configuration process in the 'php.ini' file, labelling the path to the '\libs\' directory. Before installation of smarty, my pear packages were working fine, never received any errors. However, after installing smarty and including my template file 'config.php' with 'Auth/HTTP.php' within the same file, i gor these errors;

 

Warning: require_once(Auth/HTTP.php) [function.require-once]: failed to open stream: No such file or directory in C:\xampp\htdocs\OReilly\pear\blog\login.php on line 10

 

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

 

Warning: Cannot modify header information. Headers already sent by C:\xampp\htdocs\OReilly\pear\blog\login.php on line 10

Anybody got ideas what i can do to correct this issue, thanks.

I have attached my templates file 'config.php' and my login script, the one that allows users to login be fore they access results to the database called 'login.php'

 

[attachment deleted by admin]

Link to comment
Share on other sites

Sounds to me like you have broken your include_path within your ini file. Can we see that?

 

Sure, here goes;

 

;;;;;;;;;;;;;;;;;;;;;;;;;

; Paths and Directories ;

;;;;;;;;;;;;;;;;;;;;;;;;;

 

; UNIX: "/path1:/path2"

;include_path = ".:/php/includes"

;

; Windows: "\path1;\path2"

;include_path = ".;c:\php\includes"

;

; PHP's default setting for include_path is ".;/path/to/php/pear"

; http://php.net/include-path

include_path = ".;\xampp\php\PEAR"

 

; Smarty path

include_path = ".;C:\xampp\Smarty\libs"

 

the last path is he link to smarty

Link to comment
Share on other sites

You can only set the include_path directive once, you are setting it once (using invalid paths anyway) to include PEAR, then again to include smarty.

 

You need to separate your paths by ; within one call to include_path.

 

include_path = ".;C:\xampp\php\PEAR;C:\xampp\Smarty\libs"

 

The first . ensures the current directory is on your path and that the include functions will work.

Link to comment
Share on other sites

Thank you sir,

I have just corrected the error and this is the error message  i got in the browser window;

 

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\OReilly\pear\blog\login.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\login.php:1) in C:\xampp\php\PEAR\Auth\HTTP.php on line 456

 

 

Link to comment
Share on other sites

The error states pretty clearly that you are sending output to the browser on line 1 of your login.php page.

 

You cannot send output to the browser and then call the header() function.

 

This has nothing to do with either Smarty of Zend.

Link to comment
Share on other sites

Ooh yeah, think it has to do with hidden characters in my text editor that i can't see with the naked eye. So this is what i did,first, i saved the file in ANSI format and I used an output buffering function ob_start(); at the beginning of my code to remove output before the header().Well, i got this error;

 

Fatal error: Class 'Auth_HTTP' not found in C:\xampp\htdocs\OReilly\pear\blog\login.php on line 23

 

Wuu, now what next? Did i solve the problem by creating another?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.