gmmo1971 Posted May 30, 2008 Share Posted May 30, 2008 Hi, I am trying to use some Date class functions and getting this error: code: // date class test $date = new Date(date("j"), date("n"), date("Y")); echo "Today is : " . $date . "</br>"; error: Fatal error: Class 'Date' not found in /var/www/html/test.php I did some dig in and realized--i think--that the Date class library comes from this: http://pecl.php.net/package/date_time however this is C code and not php code. My question is how do I "install" these classes into my php folder (I am using Centos)? Do I have to compile the code? Is there a way to install it without having to compile the code? Is there a pre-built lib somewhere? thx! Link to comment https://forums.phpfreaks.com/topic/107899-installing-date-class/ Share on other sites More sharing options...
trq Posted May 30, 2008 Share Posted May 30, 2008 You use pear to compile and install libs from pecl. pear install date_time Link to comment https://forums.phpfreaks.com/topic/107899-installing-date-class/#findComment-553135 Share on other sites More sharing options...
gmmo1971 Posted May 31, 2008 Author Share Posted May 31, 2008 I tried this and it didn't work either: [root@localhost Date]# pecl install date_time Failed to download pecl/date_time within preferred state "stable", latest release is version 0.1, stability "alpha", use "channel://pecl.php.net/date_time-0.1" to install Cannot initialize 'channel://pecl.php.net/date_time', invalid or missing package file Package "channel://pecl.php.net/date_time" is not valid install failed any clues? thx. Link to comment https://forums.phpfreaks.com/topic/107899-installing-date-class/#findComment-554143 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.