Jump to content

[SOLVED] pear help


sasori

Recommended Posts

first i installed pear in wamp and was able to do so.

then i installed the Date package

 

pear1qh7.jpg

 

then i tried to configure my php.ini

 

pear2er7.jpg

 

then i tried to run my simple test script to get the classes available

include('TimeZone.php');
$foo = new DateTime();
echo "the classes are ".get_class($foo)."<br/>";

 

and then error appears on my browser

pear3ot6.jpg

 

what you think guys is the problem? i need help..im just doing self study so i need guides in here.

 

:?:

Link to comment
https://forums.phpfreaks.com/topic/122083-solved-pear-help/
Share on other sites

These errors means only file is missing. Do you have file DateTime.php into folder wher your script is placed?

 

ill change my question sir,

i browse the documentation of the Date Package from pear website and it says

 

pear4zy7.jpg

 

and so I run another test script in order to output a class

 

include('TimeZone.php');
$foo = new Date();
echo "the classes are ".get_class($foo)."<br/>";

 

and it says

 

pear5eg5.jpg

Link to comment
https://forums.phpfreaks.com/topic/122083-solved-pear-help/#findComment-630291
Share on other sites

Try this example

<?php
require_once 'Date.php';

//without parameter == now
$now = new Date();

//pass a string in ISO format
$longAgo = new Date('1813-02-23T05:34:23');

//create a Date object from a PHP unix timestamp
$timestamp = time();
$nearlyNow = new Date($timestamp);

//make a copy of an existing Date object
$copyDate = new Date($longAgo);
?>

 

I gave you this example because you're trying to includeTimeZone.php instead of Date.php. I have not experience with installing pear packages on windows, but I saw no TimeZone.php, only Date.php even though you need TimeZone functionallities.

Link to comment
https://forums.phpfreaks.com/topic/122083-solved-pear-help/#findComment-630313
Share on other sites

i have a script running now..but still it has a few errors

 

<?php

include('Date/TimeZone.php');
$foo = new DateTime();
echo "the class is/are ". nl2br(print_r(get_class($foo),true));
echo "<br/>";
echo "the methods are ". nl2br(print_r(get_class_methods($foo),true));

?>

 

pear3jm0.jpg

 

what should i do now?

 

 

Link to comment
https://forums.phpfreaks.com/topic/122083-solved-pear-help/#findComment-630739
Share on other sites

i figured out the error now... daemn!, am so dumb, it took me 2 days to figure this out.

it was with the include path of my php.ini  :(

 

here's the correct path

 

include_path = ".;c:\wamp\bin\php\php5.2.5\PEAR"

 

i didn't notice the "\php" between \bin and \php5.2.5 in the firstplace  ;D

Link to comment
https://forums.phpfreaks.com/topic/122083-solved-pear-help/#findComment-631063
Share on other sites

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.