php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68841 date_default_timezone_set(), call to undefined fuction when called from html.
Submitted: 2015-01-16 00:22 UTC Modified: 2015-05-10 04:22 UTC
Votes:2
Avg. Score:4.5 ± 0.5
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: nick4 at nickniquette dot com Assigned: cmb (profile)
Status: No Feedback Package: Date/time related
PHP Version: 5.3.29 OS: linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2015-01-16 00:22 UTC] nick4 at nickniquette dot com
Description:
------------
---
From manual page: http://www.php.net/function.date-default-timezone-set
---
Fatal error: Call to undefined function: date_default_timezone_set() When called from html, causes error.  Works fine with php extensions but not with html.  the only function I've found not working in html.

.htaccess modified to include
AddType application/x-httpd-php5 .php .htm .html

Test Script is called test.html

Test script:
---------------
<?php
date_default_timezone_set('America/New_York');
?>



Expected result:
----------------
Expect no error.

Actual result:
--------------
Fatal error: Call to undefined function: date_default_timezone_set() in /home/something/public_html/test.html on line 2

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-01-16 00:47 UTC] requinix@php.net
-Status: Open +Status: Feedback -Package: HTTP related +Package: Date/time related
 [2015-01-16 00:47 UTC] requinix@php.net
Questions:
- Which Linux?
- What does phpinfo() show for the Configure Command?
- What does phpinfo() show for Configuration > date?
- Do you have any zend_extensions installed? Which? Does it work if they're all disabled?
- Did you specifically check if other date/time functions work, like date() and date_default_timezone_get()?
 [2015-01-16 21:11 UTC] nick4 at nickniquette dot com
-Status: Feedback +Status: Open
 [2015-01-16 21:11 UTC] nick4 at nickniquette dot com
- Which Linux?
 host apache 2.2.24, my os is windows 7 64bit

- What does phpinfo() show for the Configure Command?
'./configure' '--prefix=/usr/local/php53' '--mandir=/usr/man' '--with-config-file-path=/usr/local/php53/lib' '--with-config-file-scan-dir=/usr/local/php53/etc' '--with-pear=/usr/local/php53/pear' '--with-iconv' '--enable-magic-quotes' '--disable-ipv6' '--with-openssl=/usr/local/openssl-1.0.1g' '--with-zlib' '--enable-bcmath' '--with-bz2' '--enable-calendar' '--with-curl' '--with-db4' '--with-dbm' '--with-enchant' '--with-curlwrappers' '--enable-exif' '--enable-ftp' '--with-kerberos' '--enable-intl' '--with-pcre-regex' '--with-libdir=lib64' '--with-gd' '--with-pspell' '--with-libedit' '--with-readline' '--with-jpeg-dir' '--with-png-dir' '--with-zlib-dir' '--with-xpm-dir' '--with-freetype-dir' '--with-t1lib' '--enable-gd-native-ttf' '--with-gettext' '--with-imap' '--with-imap-ssl' '--with-ldap' '--with-ldap-sasl' '--enable-mbstring' '--with-mcrypt' '--with-mhash' '--with-mysql=/usr' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-icu-dir=/usr' '--with-mysqli' '--enable-pcntl' '--with-pdo-mysql' '--with-pdo-pgsql' '--with-pgsql' '--enable-shmop' '--with-snmp=shared' '--enable-ucd-snmp-hack' '--enable-soap' '--with-tidy' '--enable-sockets' '--enable-sqlite-utf8' '--enable-wddx' '--with-xmlrpc' '--with-xsl=/usr/local/libxslt' '--with-libxml-dir=/usr/local/libxml2' '--enable-zip' '--enable-zend-multibyte' 

- What does phpinfo() show for Configuration > date? 
aug 15,2014 11:06:57

- Do you have any zend_extensions installed? Which? Does it work if they're all disabled?
220090626, per phpinfo().  Not very familiar with zend extensions.  I'd have to ask my host for more info or possibly disabling.

- Did you specifically check if other date/time functions work, like date() and date_default_timezone_get()?
These functions work.

Thanks for your support.
Nick
 [2015-01-16 21:20 UTC] requinix@php.net
-Status: Open +Status: Feedback
 [2015-01-16 21:20 UTC] requinix@php.net
Not which operating system *you* are using. Which OS *PHP* is running on. It's some version of Linux, not Windows, and I'd like to know exactly which.

As for "Configuration > date", I mean to look at the Configuration heading, then below that are various blocks of configuration information. Each one has its own heading, like "bc" or "curl". What do you see for the block whose heading is "date"?

And you say you're using PHP 5.4.36. Are you sure? It's definitely not 5.3?

Oh. And you should contact your host too for support.
 [2015-01-16 22:31 UTC] nick4 at nickniquette dot com
-Status: Feedback +Status: Open -PHP Version: 5.4.36 +PHP Version: 5.3.29
 [2015-01-16 22:31 UTC] nick4 at nickniquette dot com
-Not which operating system *you* are using. Which OS *PHP* is running on. It's some version of Linux, not Windows, and I'd like to know exactly which.
panel:/root# cat /etc/redhat-release CentOS release 5.9 (Final) 

-As for "Configuration > date", I mean to look at the Configuration heading, then below that are various blocks of configuration information. Each one has its own heading, like "bc" or "curl". What do you see for the block whose heading is "date"?
date/time support  enabled  
"Olson" Timezone Database Version  2013.3  
Timezone Database  internal  
Default timezone  CST6CDT  
Directive
Local Value
Master Value
date.default_latitude 31.7667 31.7667 
date.default_longitude 35.2333 35.2333 
date.sunrise_zenith 90.583333 90.583333 
date.sunset_zenith 90.583333 90.583333 
date.timezone CST6CDT CST6CDT 

-And you say you're using PHP 5.4.36. Are you sure? It's definitely not 5.3?
PHP Version 5.3.29

-Oh. And you should contact your host too for support.
I usually do.  Looked like a bug to me.  I'll submit a ticket if you think they can resolve it.

php info is at text dot violatorsmcri dot com / testcode dot php for a short time.
Thanks for your support,
Nick
 [2015-04-29 19:12 UTC] cmb@php.net
-Status: Open +Status: Feedback
 [2015-04-29 19:12 UTC] cmb@php.net
Have a look at phpinfo and check that date_default_timezone_set is
not listed under disable_function, nor any similar Suhosin settings
(if Suhosin is installed).
 [2015-05-01 22:29 UTC] cmb@php.net
-Assigned To: +Assigned To: cmb
 [2015-05-10 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 22:01:26 2024 UTC