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! Quote 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 Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/107899-installing-date-class/#findComment-554143 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.