php script for creating an rtf document -- images missing

mitz

Registered
Jun 12, 2013
4
0
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
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,203
363
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.
 

24x7server

Well-Known Member
Apr 17, 2013
1,911
96
78
India
cPanel Access Level
Root Administrator
Twitter
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
 

mitz

Registered
Jun 12, 2013
4
0
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.
 

mitz

Registered
Jun 12, 2013
4
0
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?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,203
363
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?
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.
 

mitz

Registered
Jun 12, 2013
4
0
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,203
363
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.