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
https://forums.phpfreaks.com/topic/229554-intergrating-smarty-and-pear-packages/
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

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.

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

 

 

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?

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.