[PHP] Troubleshooting mail() and sendmail
Does anyone have any tips for general troubleshooting of mail()? The standard *nix mail command works fine from the command line, but php scripts that use php's mail() run very slowly -- then the mail ends up not getting send. I assume I have something misconfigured for sendmail but am not sure where to begin looking. I am running php 4.3.1 on RH 8.0. output of phpinfo() follows. Thanks -- Dan --- DOCUMENT_ROOT is /var/www/html DOCUMENT_ROOT is /var/www/html PHP Version 4.3.1 System Linux nikto 2.4.18-14 #1 Wed Sep 4 11:57:57 EDT 2002 i586 Build Date Jun 17 2003 01:28:09 Configure Command './configure' '--with-mysql' '--with-apxs2' Server API Apache 2.0 Filter Virtual Directory Support disabled Configuration File (php.ini) Path /usr/local/lib PHP API 20020918 PHP Extension 20020429 Zend Extension 20021010 Debug Build no Thread Safety disabled Registered PHP Streams php, http, ftp This program makes use of the Zend Scripting Language Engine: Zend Engine v1.3.0, Copyright (c) 1998-2002 Zend Technologies PHP Credits Configuration PHP Core Directive Local Value Master Value allow_call_time_pass_reference On On allow_url_fopen On On always_populate_raw_post_data Off Off arg_separator.input arg_separator.output asp_tags Off Off auto_append_file no value no value auto_prepend_file no value no value browscap no value no value default_charset no value no value default_mimetype text/html text/html define_syslog_variables Off Off disable_functions no value no value display_errors On On display_startup_errors Off Off doc_root no value no value docref_ext no value no value docref_root http://www.php.net/ http://www.php.net/ enable_dl On On error_append_string no value no value error_log no value no value error_prepend_string no value no value error_reporting no value no value expose_php On On extension_dir /usr/local/lib/php/extensions/no-debug-non-zts-20020429 /usr/local/lib/php/extensions/no-debug-non-zts-20020429 file_uploads On On gpc_order GPC GPC highlight.bg #FF #FF highlight.comment #FF8000 #FF8000 highlight.default #BB #BB highlight.html #00 #00 highlight.keyword #007700 #007700 highlight.string #DD #DD html_errors On On ignore_repeated_errors Off Off ignore_repeated_source Off Off ignore_user_abort Off Off implicit_flush Off Off include_path .:/usr/local/lib/php .:/usr/local/lib/php log_errors Off Off log_errors_max_len 1024 1024 magic_quotes_gpc On On magic_quotes_runtime Off Off magic_quotes_sybase Off Off max_execution_time 30 30 max_input_time -1 -1 open_basedir no value no value output_buffering 0 0 output_handler no value no value post_max_size 8M 8M precision 14 14 register_argc_argv On On register_globals Off Off report_memleaks On On safe_mode Off Off safe_mode_exec_dir 1 1 safe_mode_gid Off Off safe_mode_include_dir no value no value sendmail_from no value no value sendmail_path /usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i short_open_tag On On SMTP localhost localhost smtp_port 25 25 sql.safe_mode Off Off track_errors Off Off unserialize_callback_func no value no value upload_max_filesize 2M 2M upload_tmp_dir no value no value user_dir no value no value variables_order no value no value xmlrpc_error_number 0 0 xmlrpc_errors Off Off y2k_compliance On On Apache 2.0 ctype ctype functions enabled mysql MySQL Support enabled Active Persistent Links 0 Active Links 0 Client API version 3.23.49 MYSQL_MODULE_TYPE builtin MYSQL_SOCKET /var/lib/mysql/mysql.sock MYSQL_INCLUDE no value MYSQL_LIBS no value Directive Local Value Master Value mysql.allow_persistent On On mysql.connect_timeout -1 -1 mysql.default_host no value no value mysql.default_password no value no value mysql.default_port no value no value mysql.default_socket no value no value mysql.default_user no value no value mysql.max_links Unlimited Unlimited mysql.max_persistent Unlimited Unlimited mysql.trace_mode Off Off overload User-Space Object Overloading Support enabled pcre PCRE (Perl Compatible Regular Expressions) Support enabled PCRE Library Version 3.92 11-Sep-2002 posix Revision $Revision: 1.51 $ session Session Support enabled Registered save handlers files user Directive Local Value Master Value session.auto_start Off Off session.bug_compat_42 On On session.bug_compat_warn On On session.cache_expire 180 180 session.cache_limiter nocache nocache session.cookie_domain no value no value session.cookie_lifetime 0 0 session.cookie_path / / session.cookie_secure Off Off session.entropy_file no value no value session.entropy_length 0 0 session.gc_dividend 100 100 session.gc_maxlifetime 1440 1440 session.gc_probability 1 1 session.name PHPSESSID PHPSESSID session.referer_check no value no value session.save_handler files files session.save_path /tmp /tmp
[PHP] Call to undefined function: mysql_connect()
This is driving me buggy... I just upgraded to RH 8 which included an Apache 2.0 update. PHP and MySQL work OK independently; I can call mysql_connect() from the command line, but an attempt to do so from a script within Apache returns a Fatal error: Call to undefined function: mysql_connect() I tried to install php-mysql-4.2.2-8.0.7.i386.rpm but am getting: warning: php-mysql-4.2.2-8.0.7.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e error: Failed dependencies: php = 4.2.2-8.0.7 is needed by php-mysql-4.2.2-8.0.7 libmysqlclient.so.10 is needed by php-mysql-4.2.2-8.0.7 Attempts to install the client RPM return messages that it's already installed. I saw a message in the RH archive about this, but could not locate a resolution. phpinfo dump follows. System info: PHP Version 4.2.2 RH Kernel 2.4.18-14 Server API Apache 2.0 Filter Apache 2.0.40 Thanks... Dan PHP Version 4.2.2 System Linux daffy.perf.redhat.com 2.4.18-11smp #1 SMP Thu Aug 15 06:41:59 EDT 2002 i686 i686 i386 GNU/Linux Build Date Sep 3 2002 05:25:09 Configure Command './configure' '--host=i686-pc-linux-gnu' '--build=i686-pc-linux-gnu' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--prefix=/usr' '--with-config-file-path=/etc' '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-db3' '--with-curl' '--with-dom=/usr' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-ttf' '--with-gdbm' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-regex=system' '--with-xml' '--with-expat-dir=/usr' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-discard-path' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--without-oci8' '--with-pear=/usr/share/pear' '--with-imap=shared' '--with-imap-ssl' '--with-kerberos=/usr/kerberos' '--with-ldap=shared' '--with-mysql=shared,/usr' '--with-pgsql=shared' '--with-snmp=shared,/usr' '--with-snmp=shared' '--enable-ucd-snmp-hack' '--with-unixODBC=shared' '--enable-memory-limit' '--enable-bcmath' '--enable-shmop' '--enable-versioning' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mcal' '--with-apxs2=/usr/sbin/apxs' Server API Apache 2.0 Filter Virtual Directory Support disabled Configuration File (php.ini) Path /etc/php.ini Debug Build no Thread Safety disabled This program makes use of the Zend Scripting Language Engine: Zend Engine v1.2.0, Copyright (c) 1998-2002 Zend Technologies PHP 4 Credits Configuration PHP Core Directive Local Value Master Value allow_call_time_pass_reference On On allow_url_fopen 1 1 always_populate_raw_post_data 0 0 arg_separator.input arg_separator.output asp_tags Off Off auto_append_file no value no value auto_prepend_file no value no value browscap no value no value default_charset no value no value default_mimetype text/html text/html define_syslog_variables Off Off disable_functions no value no value display_errors On On display_startup_errors Off Off doc_root no value no value enable_dl On On error_append_string no value no value error_log no value no value error_prepend_string no value no value error_reporting 2039 2039 expose_php On On extension_dir /usr/lib/php4 /usr/lib/php4 file_uploads 1 1 gpc_order GPC GPC highlight.bg #FF #FF highlight.comment #FF9900 #FF9900 highlight.default #CC #CC highlight.html #00 #00 highlight.keyword #006600 #006600 highlight.string #CC #CC html_errors On On ignore_user_abort Off Off implicit_flush Off Off include_path .:/usr/share/pear .:/usr/share/pear log_errors Off Off magic_quotes_gpc On On magic_quotes_runtime Off Off magic_quotes_sybase Off Off max_execution_time 30 30 memory_limit 8M 8M open_basedir no value no value output_buffering no value no value output_handler no value no value post_max_size 8M 8M precision 14 14 register_argc_argv On On register_globals Off Off safe_mode Off Off safe_mode_exec_dir no value no value safe_mode_gid Off Off safe_mode_include_dir no value no value sendmail_from [EMAIL PROTECTED] [EMAIL PROTECTED] sendmail_path /usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i short_open_tag Off Off SMTP localhost localhost
[PHP] Constants and Here Document Interpolation
Can anyone tell me if it is possible (and how) to use defined constants within here document content? I've not been successful finding anything on this in the online docs. Thanks! Dan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
FW: [PHP] Constants and Here Document Interpolation
Actually I did try it and couldn't think of a way to work around the matter. Thanks for the suggestion. -Original Message- From: Ernest E Vogelsinger [mailto:[EMAIL PROTECTED] Sent: Saturday, March 01, 2003 12:56 PM To: Daniel R. Hansen Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Constants and Here Document Interpolation At 16:56 01.03.2003, Daniel R. Hansen said: [snip] Can anyone tell me if it is possible (and how) to use defined constants within here document content? I've not been successful finding anything on this in the online docs. [snip] You simply could have tried it - it's trivial. The answer: no, you cannot have a constant within a string, be it heredoc or quoted. A constant must always reside on native code level. However you can easily concatenate strings and heredocs - both of the examples below work correctly: define('A_CONSTANT', 1); $text1 = EOT This heredoc text contains the constant A_CONSTANT ( EOT . A_CONSTANT . EOT ) outside the heredoc construct... EOT; $text2 = This quoted text contains the constant A_CONSTANT ( . A_CONSTANT . ) outside the string quotes...; echo $text1br /$text2; Output: This heredoc text contains the constant A_CONSTANT (1) outside the heredoc construct... This quoted text contains the constant A_CONSTANT (1) outside the string quotes... -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
FW: [PHP] Constant Arrays Possible?
I know constants can't be changed or undefined; the use I have in mind won't be; the array size and elements would be completely static. I'm just looking to do this for the sake of ease of access to its elements and to eliminate the need to redeclare the array as global in every bleeping function that uses its data. -Original Message- From: Ernest E Vogelsinger [mailto:[EMAIL PROTECTED] Sent: Sunday, February 23, 2003 6:56 AM To: Daniel R. Hansen Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Constant Arrays Possible? At 20:28 22.02.2003, Daniel R. Hansen said: [snip] Is it possible to define a constant that is an array of other predefined constants? If so, what would the syntax be? I'm trying something like the following (all items prefixed with an uppercase G are constants) without success: [snip] No, it is not possible. From the online manual (http://www.php.net/manual/en/language.constants.php): Syntax You can define a constant by using the define()-function. Once a constant is defined, it can never be changed or undefined. -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Constant Arrays Possible?
Is it possible to define a constant that is an array of other predefined constants? If so, what would the syntax be? I'm trying something like the following (all items prefixed with an uppercase G are constants) without success: define(GaNavButtons, array( GnavSectionHome = array ( GsectionSelected = Gb_home, GsectionUnSelected = Gb_home_uns), GnavSectionLinks = array ( GsectionSelected = Gb_links, GsectionUnSelected = Gb_links_uns), GnavSectionAbout = array ( GsectionSelected = Gb_about, GsectionUnSelected = Gb_about_uns), GnavSectionContact = array ( GsectionSelected = Gb_contact, GsectionUnSelected = Gb_contact_uns), GnavSectionShopping = array ( GsectionSelected = Gb_shopping, GsectionUnSelected = Gb_shopping_uns)); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Sitewide Header Footer Includes || Trouble with Relative Paths..........
I do the following and it seems to work OK: I put the following two lines at the top of each script: $defsPath = [my include path]defs/; include_once($defsPath.globals.php3); ...and later a call to a function I wrote ( printNavLinks() ) that outputs whatever I want in the header/footer. The function is defined in another include file included by globals.php3. -Original Message- From: CF High [mailto:[EMAIL PROTECTED] Sent: Saturday, February 22, 2003 5:13 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Sitewide Header Footer Includes || Trouble with Relative Paths.. Hey Tom. Thanks for the idea; however, since we're not hosting the site on our own server, we don't have permissions for altering the php.ini file.. --Noah Tom Rogers [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, Sunday, February 23, 2003, 6:14:32 AM, you wrote: CH Hey All. CH Got a perhaps easy question here: CH How can I create a global header and footer include to my site pages where I CH don't rely on absolute paths to include and image files? CH I'm having trouble including my header and footer .inc's within a CH multi-level directory structure -- the relative paths to images (and to CH includes within includes) are not currently accessed within the current CH directory structure. CH I'm assuming I'll need to prepend all image and include files with a path CH variable that I set within each page, or something along those lines? CH Any help much appreciated, CH --Confused CH -- I do this at the top of my scripts ini_set (include_path,'path/to/inc/dir:'.ini_get(include_path)); that way you just do include('file.inc') from anywhere and it will find your files. -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
FW: [PHP] Sitewide Header Footer Includes || Trouble with Relative Paths..........
As long as your headers/footers are static, you could define them as constants, include just the script that defines the constants, and do a print(SOME_FOOTER_NAME); where you want them to appear. -Original Message- From: CF High [mailto:[EMAIL PROTECTED] Sent: Saturday, February 22, 2003 5:19 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Sitewide Header Footer Includes || Trouble with Relative Paths.. Hmm Sounds like a good idea, but we've got quite a few includes in our site, not to mention variable image paths (i.e. images/headers, images/groups, etc.) Seems like a lot of work to create maintain this config file + load the references on each page. Maybe I'm just lazy, but I wonder if there is isn't a more direct way to modularize a site? I'll check out your idea in any case as I haven't come up with a better solution myself. Thanks for the feedback, --Noah Sebastian [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] What I did on my site is made a file called config.php, I then made a variable for all the files that need to be included, example, header, footer, leftnav, rightnav, etc.. My config file looks like this: ?php $header =/home/public_html/includes/header.php; $rightnav=/home/public_html/includes/rightnav.php; $leftnav =/home/public_html/includes/leftnav.php; $footer =/home/public_html/includes/footer.php; // and many other include variables here.. ? Then I simply call config.php into all my pages and when I want to include a file I just do: ?php include($header); // html and stuff include($footer); ? my config.php has all my site includes and it allows me to dynamically change anything throughout the site in a matter of seconds. hope this helps. Sebastian - [BBR] Gaming Clan http://www.BroadBandReports.com - Original Message - From: CF High [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, February 22, 2003 3:14 PM Subject: [PHP] Sitewide Header Footer Includes || Trouble with Relative Paths.. Hey All. Got a perhaps easy question here: How can I create a global header and footer include to my site pages where I don't rely on absolute paths to include and image files? I'm having trouble including my header and footer .inc's within a multi-level directory structure -- the relative paths to images (and to includes within includes) are not currently accessed within the current directory structure. I'm assuming I'll need to prepend all image and include files with a path variable that I set within each page, or something along those lines? Any help much appreciated, --Confused -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php