Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Newbie question on open_basedir error

  1. #1
    Join Date
    Feb 2005
    Posts
    11

    Default Newbie question on open_basedir error

    I have followed all of the instructions to set up Formmail.php

    I am running Apache and PHP5 and have this line of code in php.ini on my server:

    open_basedir = "c:/wamp/www/mysite"

    All other aspects of my site functions are working fine.

    When I run http://www.mysite.com/sample.htm I receive this response:

    Thanks! We've received your information and, if it's appropriate, we'll be in contact with you soon.

    Warning: tempnam() [function.tempnam]: open_basedir restriction in effect. File(tmp) is not within the allowed path(s): (c:/wamp/www/mysite) in c:\wamp\www\mysite\formmail.php on line 903

    Line 903 in formmail.php reads:

    $s_name = tempnam("/tmp",$s_prefix);

    I have created a tmp subdirectory in c:/wamp/www/mysite

    What am I doing wrong?

    Thanks for a great product.

  2. #2
    Join Date
    Dec 2003
    Posts
    3,980

    Default Re: Newbie question on open_basedir error

    Hi,

    It's just a server setup issue.

    You can workaround the problem by using the $SCRATCH_PAD configuration in FormMail - read the doco above it for details.

    But, basically you want to create your own directory within "c:/wamp/www/mysite" and then set $SCRATCH_PAD to that directory path you've created. Make the directory writable by your webserver (i.e. world) and FormMail will use that instead of /tmp.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  3. #3
    Join Date
    Feb 2005
    Posts
    11

    Unhappy Re: Newbie question on open_basedir error

    Hi Russell:

    I thought I was understanding the instructions before you replied so I had created the folder and changed the code to this:

    $SCRATCH_PAD = "c:/wamp/www/fmscratchpad"; // at Line 1842

    Now I get this error:


    Warning: mail() [function.mail]: SMTP server response: 501 Syntax error. Syntax:{RCPT TO:<address> [SIZE=msgSize]} in c:\wamp\www\mysite\formmail.php on line 2943
    An error occurred while processing the form.

    Please contact us directly since this form is not working.
    We apologize for any inconvenience this error may have caused.
    Warning: mail() [function.mail]: SMTP server response: 501 Syntax error. Syntax:{RCPT TO:<address> [SIZE=msgSize]} in c:\wamp\www\mysite\formmail.php on line 2943
    so I changed line 2908 from referring to the ORIGINAL location of your downloaded ZIP file on my local machine to this on the server:


    require_once("file:///C|/wamp/www/mysite/Mail.php");

    But I don't have a file called mail.php anywhere, do I?
    I am getting lost-er and lost-er.

  4. #4
    Join Date
    Dec 2003
    Posts
    3,980

    Default Re: Newbie question on open_basedir error

    Hi,

    Believe it or not, that's progress. You've overcome the temporary directory problem and now hit the next problem.

    The require_once("Mail.php") is including the PEAR Mail support.

    If that's not working, then it would seem your server doesn't have PEAR installed, or the PHP configuration (php.ini) has not been set correctly to find PEAR files.

    The next step (apart from putting the code back the way it was) is to contact your hosting company and asking them about PEAR support and whether the include_path in php.ini is set correctly.

    Windows servers usually have a lot of PHP configuration problems.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  5. #5
    Join Date
    Feb 2005
    Posts
    11

    Default Re: Newbie question on open_basedir error

    Oh, oh.

    I AM the web host.

    I pay for a dedicated server and have 100% control over the php.ini file.

    I will check the php.ini settings and follow your directions.

    Whew!!! Who said this stuff was easy? ..............

    OK. The PEAR folder is in

    C:\wamp\php\PEAR

    Is there a setting in php.ini to point to it?
    Last edited by zenprofit; 11-Feb-2005 at 10:54 PM.

  6. #6
    Join Date
    Feb 2005
    Posts
    11

    Default Re: Newbie question on open_basedir error

    OK.

    I have now changed the line in the php.ini file:

    ; Windows: "\path1;\path2"
    include_path = ".;c:\wamp\php\PEAR"

    to point to the PEAR subfolder in the php directory and restarted the services.

    In formmail.php I reverted back to the original code in line 2908 which still refers to a mail.php file that doesn't exist.

    Line 2943 reads:

    return (mail($s_to,$s_subject,$s_mesg,ExpandMailHeaders($a_headers)));

    and the error returned is:

    Warning: mail() [function.mail]: SMTP server response: 501 Syntax error. Syntax:{RCPT TO:<address> [SIZE=msgSize]} in c:\wamp\www\mysite\formmail.php on line 2943
    An error occurred while processing the form.

    Please contact us directly since this form is not working.
    We apologize for any inconvenience this error may have caused.
    Warning: mail() [function.mail]: SMTP server response: 501 Syntax error. Syntax:{RCPT TO:<address> [SIZE=msgSize]} in c:\wamp\www\mysite\formmail.php on line 2943


    Any thoughts?

  7. #7
    Join Date
    Dec 2003
    Posts
    3,980

    Default Re: Newbie question on open_basedir error

    Hi,

    Step 1 is to decide whether or not you PEAR mailing support. You only need PEAR mailing if your server's PHP won't send mail for you.

    I recommend you refer to the Sticky posts at the top of this forum which have some test scripts for testing your mail service.

    If you can send mail with these test scripts, then you do not need PEAR mailing support - it means that the PHP "mail" function will work on your server. In this case, don't set the $PEAR... configs in FormMail. If you don't set them, then FormMail won't try and load the include files (not sure about PHP 5, though).

    If they don't work, then you will need PEAR support.

    But, since you have full control over your server, this won't be required. It's good that you do have full control, but, it does mean you need to understand more about your server.

    In php.ini, there are settings for controlling mail sending on Windows boxes:

    Code:
    [mail function]
    ; For Win32 only.
    SMTP = your-smtp-mailserver
    ; For Win32 only.
    sendmail_from = your-email-address
    You'll need to set these appropriately. Use our testmail scripts to test until you've got your settings correct.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  8. #8
    Join Date
    Feb 2005
    Posts
    11

    Default Re: Newbie question on open_basedir error

    Russell:

    I am struggling up the learning curve on this topic. The testmail.php file works perfectly, no error messages.

    Sample.htm works, but not without an error message. The FROM: pulls the address from sendmail_from= correctly.

    This is the email received at my email InBox after sending sample.htm:

    email: me@me.com
    contact: me
    colors: yellow
    vehicles: Truck
    mesg: H2

    ==================================

    REMOTE_HOST=
    REMOTE_ADDR=70.106.86.206
    HTTP_USER_AGENT=Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)
    REMOTE_USER=



    This is what appears on the screen after the send:

    Thanks! We've received your information and, if it's appropriate, we'll be in contact with you soon.
    Warning: mail() [function.mail]: SMTP server response: 501 Syntax error. Syntax:{RCPT TO:<address> [SIZE=msgSize]} in c:\wamp\www\mysite\formmail.php on line 2950

    Lines 1870-1873 in formmail.php read:

    $PEAR_SMTP_HOST = "";
    $PEAR_SMTP_PORT = 25;
    $PEAR_SMTP_USER = "";
    $PEAR_SMTP_PWD = "";

    Line 2950 reads:

    return (mail($s_to,$s_subject,$s_mesg,ExpandMailHeaders($a_headers)));

    I have confirmed that the latest copy of formmail.php sits on the server.

    This is apparently a PEAR setting issue. I am running PHP Version 5.0.3.

    Any more thoughts? [I appreciate your patience with me.]

    Zack

  9. #9
    Join Date
    Feb 2005
    Posts
    11

    Default Re: Newbie question on open_basedir error

    Russell:

    As I try to resolve the PEAR issue, I find that in the virgin formmail.php at Line 2915 there is:

    require_once("Mail.php");

    What does this refer to? I can find no mail.php file anywhere.

    Thanks for your attention to this.

  10. #10
    Join Date
    Dec 2003
    Posts
    3,980

    Default Re: Newbie question on open_basedir error

    Hi,

    It's not a PEAR issue because you have PEAR disabled in FormMail:
    PHP Code:
    $PEAR_SMTP_HOST ""
    I think the problem is pretty clear - your mail server doesn't like the syntax of address that PHP is sending to it.

    So, it might be the format that FormMail is using. But since that's a valid format, the server should not be complaining.

    Do you get the same error with the testmail script?

    Do you get an error if you do a testalert?
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. TARGET_EMAIL question
    By middleburyman in forum FormMail Subscription Support
    Replies: 1
    Last Post: 03-Sep-2004, 09:30 PM
  2. Uploading question
    By tray in forum FormMail Subscription Support
    Replies: 2
    Last Post: 11-Aug-2004, 10:31 PM
  3. Newbie please help no recipents error
    By Mikej in forum FormMail Subscription Support
    Replies: 3
    Last Post: 23-Apr-2004, 06:55 AM
  4. Newbie: Help for the .php challenged
    By jeanie in forum FormMail Subscription Support
    Replies: 7
    Last Post: 29-Mar-2004, 09:49 PM
  5. at mangle / e-mail question
    By Ibis in forum FormMail Subscription Support
    Replies: 3
    Last Post: 25-Feb-2004, 03:59 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •