jamiguel77 Posted January 5, 2008 Share Posted January 5, 2008 hi all how activate the calendar in php on windows i read: http://mx2.php.net/calendar and say: The windows version of PHP has built in support for this extension. You do not need to load any additional extension in order to use these functions. but when i try work with: $date=time(); $day=date('d',$date); $month=date('m',$date); $year=date('Y',$date); $days_in_month=cal_days_in_month(0,$month, $year); 127.0.0.1 - - [24/Dec/2007:08:07:30 -0700] "GET /calphpSinBd/calendar.php HTTP/1.1" 200 - PHP Fatal error: Call to undefined function cal_days_in_month() in C:\ProgramInstall\Apache Software Foundation\Apache2.2\Apache2.2\htdocs\calphpSinBD\calendar.php on line 19 of course the line 19 is: Quote Link to comment https://forums.phpfreaks.com/topic/84570-how-activate-the-calendar-in-windows/ Share on other sites More sharing options...
revraz Posted January 5, 2008 Share Posted January 5, 2008 Looks like you're runnning Apache, not Windows. Quote Link to comment https://forums.phpfreaks.com/topic/84570-how-activate-the-calendar-in-windows/#findComment-430914 Share on other sites More sharing options...
hitman6003 Posted January 5, 2008 Share Posted January 5, 2008 Uncomment the calendar.dll extension in php.ini Quote Link to comment https://forums.phpfreaks.com/topic/84570-how-activate-the-calendar-in-windows/#findComment-430918 Share on other sites More sharing options...
jamiguel77 Posted January 5, 2008 Author Share Posted January 5, 2008 note i use apache amd php PHP Version 5.2.3 i try search in c:\php\php.ini the calendar.dll and havent... cant uncomment it thanks C:\>dir calendar.dll /s Volume in drive C has no label. Volume Serial Number is 5A0A-0BB5 File Not Found C:\> other way? Quote Link to comment https://forums.phpfreaks.com/topic/84570-how-activate-the-calendar-in-windows/#findComment-430949 Share on other sites More sharing options...
trq Posted January 5, 2008 Share Posted January 5, 2008 Looks like you're runnning Apache, not Windows. They are two entirely different things. One, a web server, the other, an operating system. note i use apache amd php PHP Version 5.2.3 i try search in c:\php\php.ini the calendar.dll and havent... cant uncomment it thanks C:\>dir calendar.dll /s Volume in drive C has no label. Volume Serial Number is 5A0A-0BB5 File Not Found C:\> other way? There is no other way. Locate your php.ini and uncomment the line that reads calender.dll Quote Link to comment https://forums.phpfreaks.com/topic/84570-how-activate-the-calendar-in-windows/#findComment-430962 Share on other sites More sharing options...
jamiguel77 Posted January 5, 2008 Author Share Posted January 5, 2008 thorme yes i know! but into c:\php\php.ini havent a word: calendar.dll none for uncoment understand me? here my php.ini i open php.ini with notepad.exe and search: calendar, not found! thanks Quote Link to comment https://forums.phpfreaks.com/topic/84570-how-activate-the-calendar-in-windows/#findComment-430978 Share on other sites More sharing options...
jamiguel77 Posted January 5, 2008 Author Share Posted January 5, 2008 also i aded: extension=calendar.dll restarted my apache web server and wont work in acces.log say: PHP Fatal error: Call to undefined function cal_days_in_month() in C:\ProgramInstall\Apache Software Foundation\Apache2.2\Apache2.2\htdocs\calphpSinBD\calendar.php on line 19 127.0.0.1 - - [03/Jan/2008:22:35:23 -0700] "GET /calphpSinBD/calendar.php HTTP/1.1" 200 - remember calendar.dll not exist in my windows box.... thanks Quote Link to comment https://forums.phpfreaks.com/topic/84570-how-activate-the-calendar-in-windows/#findComment-430993 Share on other sites More sharing options...
PFMaBiSmAd Posted January 5, 2008 Share Posted January 5, 2008 First of all, there is no .dll required to use this extension. If there was it would not be named calender.dll anyway. (I won't write what it would be named to avoid adding to the confusion.) The posted code works on my php5 development system, so that either indicates calender support was not included in your build of php or that specific function has been disabled. Have you tried any of the other "calender" functions to see if they work? How did you obtain your copy of php? I am guessing that you did not get it as a pre-complied Windows binary from php.net. Create a .php file with a phpinfo(); statement in it in the same folder where the posted code is at and browse to it. Scroll down or search for the "calender" section and see if the section is present and if the calender extension is enabled. Also tell us what version php is indicated in the phpinfo() output. Quote Link to comment https://forums.phpfreaks.com/topic/84570-how-activate-the-calendar-in-windows/#findComment-431018 Share on other sites More sharing options...
jamiguel77 Posted January 5, 2008 Author Share Posted January 5, 2008 i use version: PHP Version 5.2.3 i do the phpinfo() webpage and try looking "cale" Ctrl+F only found: Configure Command cscript /nologo configure.js "--enable-prefix=C:\cygwin\tmp\build.core-php-nts-5.2.3.3580\core-php-nts-5.2.3\php-5.2.3\.." "--enable-memory-limit" "--with-openssl=C:\cygwin\tmp\build.core-php-nts-5.2.3.3580\core-php-nts-5.2.3\php-5.2.3\.." "--with-extra-includes=C:\cygwin\tmp\build.core-php-nts-5.2.3.3580\core-php-nts-5.2.3\php-5.2.3\..\usr\include" "--with-extra-libs=C:\cygwin\tmp\build.core-php-nts-5.2.3.3580\core-php-nts-5.2.3\php-5.2.3\..\usr\lib" "--disable-ipv6" "--disable-bcmath" "--disable-calendar" "--disable-ftp" "--without-gd" "--disable-odbc" "--without-sqlite" "--disable-tokenizer" "--with-libxml" "--with-iconv" "--disable-force-cgi-redirect" "--enable-fastcgi" "--enable-cli-win32" "--enable-pdo" "--disable-zts" "--disable-xmlwriter" aum i have downloaded the php so so about 1-2 years.... thanks Quote Link to comment https://forums.phpfreaks.com/topic/84570-how-activate-the-calendar-in-windows/#findComment-431038 Share on other sites More sharing options...
PFMaBiSmAd Posted January 5, 2008 Share Posted January 5, 2008 Wherever you got that from, it was not from php.net. "--disable-calendar" The calendar extension was deliberately disabled and there is no way for you to enable it unless you install a build of php that has support for it enabled. Goto http://www.php.net/downloads.php to get the official Windows binary build of php. Quote Link to comment https://forums.phpfreaks.com/topic/84570-how-activate-the-calendar-in-windows/#findComment-431041 Share on other sites More sharing options...
jamiguel77 Posted January 5, 2008 Author Share Posted January 5, 2008 ok, can you show me wich steps, for install the new version? i downloaded: http://mx.php.net/get/php-5.2.5-Win32.zip/from/a/mirror now? empty the c:\php dir unzip here the new version restart apache and... work? thanks Quote Link to comment https://forums.phpfreaks.com/topic/84570-how-activate-the-calendar-in-windows/#findComment-431049 Share on other sites More sharing options...
PFMaBiSmAd Posted January 5, 2008 Share Posted January 5, 2008 I would rename your existing php folder and keep it in case there are some files in it that you need, such as your php.ini file. If your current php installation did not involve coping any files to other places, all you would need to do is replace the files in the php folder with the new files and then update the new recommended php.ini (rename or copy php.ini-recommended to php.ini) file with your custom settings from you existing php.ini and then put the resultant php.ini file where php is expecting to load it from. Quote Link to comment https://forums.phpfreaks.com/topic/84570-how-activate-the-calendar-in-windows/#findComment-431051 Share on other sites More sharing options...
jamiguel77 Posted January 5, 2008 Author Share Posted January 5, 2008 i stoped apache renamed: c:\php to c:\php.bak unziped the php5.2.5 into c:\php renamed: php.ini-recommended to php,ini started apache opened the phpinfo() webpage and continue the version 5.2.3 why? how apply the new php version? thanks Quote Link to comment https://forums.phpfreaks.com/topic/84570-how-activate-the-calendar-in-windows/#findComment-431093 Share on other sites More sharing options...
jamiguel77 Posted January 5, 2008 Author Share Posted January 5, 2008 *php,ini php.ini Quote Link to comment https://forums.phpfreaks.com/topic/84570-how-activate-the-calendar-in-windows/#findComment-431099 Share on other sites More sharing options...
PFMaBiSmAd Posted January 5, 2008 Share Posted January 5, 2008 My guess is that there are some files that were put into another folder that Apache is using. Find your Apache httpd.conf file and search for a line with the following - LoadModule php5_module This should have a path/file that points to your php folder and would normally look like the following for Apache2.2 - LoadModule php5_module "c:/php/php5apache2_2.dll" Quote Link to comment https://forums.phpfreaks.com/topic/84570-how-activate-the-calendar-in-windows/#findComment-431103 Share on other sites More sharing options...
jamiguel77 Posted January 5, 2008 Author Share Posted January 5, 2008 ahhh yes i remember.... i installed Zend, checking phpinfo() i see: Loaded Configuration File C:\Program Files\Zend\Core\etc\php.ini and in httpd.conf i have these lines: #LoadModule php5_module c:/php/php5apache2_2.dll and all words related to zend: LoadModule zend_enabler_module "C:/Program Files/Zend/Core/modules/apache2.2/zend_fcgi.dll" FastCgiConfig "C:/Program Files/Zend/Core/etc/fastcgi.conf" <Location /ZendCore> Order deny,allow Allow from all </Location> Alias /ZendCore "C:/Program Files/Zend/Core/GUI" then my apache not know: c:/php/php.ini right? which need modify for point to c:/php/php.ini is possible my zend program continue working? thanks Quote Link to comment https://forums.phpfreaks.com/topic/84570-how-activate-the-calendar-in-windows/#findComment-431374 Share on other sites More sharing options...
jamiguel77 Posted January 10, 2008 Author Share Posted January 10, 2008 hi friend... how point httpd.conf get/work the c:\php\php.ini thanks Quote Link to comment https://forums.phpfreaks.com/topic/84570-how-activate-the-calendar-in-windows/#findComment-435383 Share on other sites More sharing options...
wildteen88 Posted January 10, 2008 Share Posted January 10, 2008 Add PHPIniDir to httpd.conf like so: PHPIniDir "C:/php/php.ini" PHP should now be reading the php.ini within C:/php NOTE: Make sure you save the httpd.conf and restart Apache after any changes. Also to test to see if PHP is reading the php.ini in C:/php create a test php file with the following code: <?php phpinfo(); ?> Find the line that starts with Loaded Configuration File. It should be set to C:/php/php.ini Quote Link to comment https://forums.phpfreaks.com/topic/84570-how-activate-the-calendar-in-windows/#findComment-435812 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.