Jump to content

How Activate the calendar in Windows ?


Recommended Posts

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:

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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"

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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