The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

php script for creating an rtf document -- images missing

Discussion in 'General Discussion' started by mitz, Jun 19, 2013.

  1. mitz

    mitz Registered

    Joined:
    Jun 12, 2013
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi,

    I'm brand new to CPanel, but not to CentOS linux.

    We have a php script that creates an RTF document using database information and uploaded photos.

    The script runs fine and collects the database info, but when we open the document, there are no pictures (this has been working fine for years on at least 3 different servers). I've made sure the file and directory permissions are correct (644 files, 755 directories). All images are owned by the same user process that Apache runs with. I can view the picture in question by directly typing the url into my browser.

    I've tried a relative path, absolute path, and even made a soft symlink in the script's directory to allow another means of getting to the pictures in question, but still no pictures.

    I rsync'd the site to my home linux server and tried the script as a test, and it works as expected.

    It's got to be a mod_security issue or something in httpd.conf, but I can't figure it out. Any advice?

    cPanel Version 11.38.0 (build 18)
    Theme x3
    Apache version 2.2.24
    PHP version 5.3.25
    MySQL version 5.1.69-cll
    Architecture x86_64
    Operating system linux
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Do you notice any specific errors in the Apache error log (/usr/local/apache/logs/error_log) or in the individual error logs within the account during the time period where the script generates the documents?

    Thank you.
     
  3. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,145
    Likes Received:
    34
    Trophy Points:
    48
    Location:
    India
    cPanel Access Level:
    Root Administrator
    If you think that this could be the issue of mod_security then there should be logs in apache error logs file, It would be great if you can provide it here.

    Also check if there are any php errors occurring
     
  4. mitz

    mitz Registered

    Joined:
    Jun 12, 2013
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Error log (tons and tons of these, but nothing else):

    [Wed Jun 19 11:50:33 2013] [error] [client xx.xx.xx.xx] File does not exist: /home/american/public_html/404.shtml
    [Wed Jun 19 11:50:33 2013] [error] [client xx.xx.xx.xx] File does not exist: /home/american/public_html/favicon.ico

    I've seen errors related to mod_security on a different server, so I know what they look like. There are none in the CPanel error log.

    In the error_log that I found in public_html directory, there are some errors regarding headers already sent, but I know what's doing that, and when I empty the log and try to run the script, it doesn't generate any additional errors.

    PS this is a dedicated server. I also have WHM, and there are no rules in the mod_security section.
     
  5. mitz

    mitz Registered

    Joined:
    Jun 12, 2013
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Question: so that's 3 different error logs located in 3 different places:

    1. in CPanel (error log icon)
    2. /usr/local/apache/logs/error_log
    3. PHP error log in my document root

    That's a lot of places to look. What's the difference for the first 2? Is #2 the unified log for every Apache instance?
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    The Apache error log (/usr/local/apache/logs/error_log) will display all of the Apache error messages, while the "Error Log" option in cPanel will show the Apache errors associated with the individual account.

    Thank you.
     
  7. mitz

    mitz Registered

    Joined:
    Jun 12, 2013
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hmmm...

    /usr/local/apache/logs/error_log shows 224 restarts in a 1 month period. That seems odd.

    There is a large number of mod_security entries involving a phpMyAdmin attack.

    And there is something called 'leechprotect' going on, although when I went to that area of CPanel, it says it wasn't enabled for any folders.
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    You can find information about the Apache restarts on this post:

    Why is Apache restarting every 2 hours

    The leech protection option should not result in a failure of your script. Have you consulted with the script developer about any potential solutions?

    Thank you.
     
Loading...

Share This Page