Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 608
  • Last Modified:

define_syslog_variables, open_log

I am typing words from a tutorial to an ide.  I do not understand what I am doing.

<?php
 define_syslog_variables();
 openlog("CHP7",LOG_USER);
 syslog(LOG_WARNING,"Chapter 7 example warning.");
 closelog();

Open in new window


Deprecated: Function define_syslog_variables() is deprecated in C:\wamp\www\oop-beg\ch6-3.php on line 2

Warning: openlog() expects exactly 3 parameters, 2 given in C:\wamp\www\oop-beg\ch6-3.php on line 3
0
rgb192
Asked:
rgb192
  • 2
3 Solutions
 
Loganathan NatarajanLAMP DeveloperCommented:
yes, This function has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.

ref. http://www.php.net/manual/en/function.define-syslog-variables.php
0
 
Loganathan NatarajanLAMP DeveloperCommented:
What is the php version you're using? please check with it. There are most list of functions given here, http://www.php.net/manual/en/migration53.deprecated.php
0
 
Ray PaseurCommented:
As always with PHP functions, if you're not sure what you're doing you can look them up on the PHP.net web site.  I couldn't work at all without it!  Unfortunately the way PHP has organized the pages, it requires you to scroll down quite a bit to see the deprecation warning.  But if you're going to use a function, you really should take a moment to read the entire man page, including the user-contributed notes.
words from a tutorial
Apparently a very, very antiquated tutorial!  I would get away from that -- it will probably be teaching you things that are no longer usable with PHP.

The current version of PHP is at minimum 5.4+ or 5.5+ so it follows that this function is no longer usable at all.

In my experience, I have never had any use for syslog.  Contrast error_log() and trigger_error() which are very useful!
0
 
rgb192Author Commented:
PHP manual, and do not use syslog
Thanks.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now