Edit report at https://bugs.php.net/bug.php?id=68841&edit=1
ID: 68841
Updated by: cmb@php.net
Reported by: nick4 at nickniquette dot com
Summary: date_default_timezone_set(), call to undefined
fuction when called from html.
-Status: Open
+Status: Feedback
Type: Bug
Package: Date/time related
Operating System: linux
PHP Version: 5.3.29
Block user comment: N
Private report: N
New Comment:
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).
Previous Comments:
------------------------------------------------------------------------
[2015-01-16 22:31:30] 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-01-16 21:20:08] 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 21:11:52] 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-p!
cntl' '--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 00:47:50] 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 00:22:35] 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
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=68841&edit=1