Jump to content
Jack_mcs

SiteMonitor

Recommended Posts

It looks like you didn't set up the confiugre file correctly since the error says, "Warning: opendir(/home/username/public_html)..." You need to change username to your username.

 

Jack

Share this post


Link to post
Share on other sites

Jack,

 

Thanks. You are right.

 

Initially I had made the right settings to the configuration, then I went back and reloaded the PHP files again from the contribution to have the English files insted of the Portuguese files that I initially setup.......

 

Looks OK now.

 

Many thanks again for your help and for this wonderful contrib.

 

dca

Share this post


Link to post
Share on other sites

got this errors after installing:

 

Warning: filesize() [function.filesize]: Stat failed for sitemonitor_log.txt (errno=2 - No such file or directory) in /home/xxx/public_html/admin/includes/functions/sitemonitor_functions.php on line 59

 

Warning: opendir() [function.opendir]: open_basedir restriction in effect. File(/home/username/public_html) is not within the allowed path(s): (/home/xxx:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/xxx/public_html/admin/includes/functions/sitemonitor_functions.php on line 71

 

Warning: opendir(/home/username/public_html) [function.opendir]: failed to open dir: Operation not permitted in /home/xxx/public_html/admin/includes/functions/sitemonitor_functions.php on line 71

 

Warning: readdir(): supplied argument is not a valid Directory resource in /home/xxx/public_html/admin/includes/functions/sitemonitor_functions.php on line 73

Reference file creation failed.

 

 

where does this sitemonitor_log.txt has to be created?

 

When I first went into Admin -> Site Monitor the message was that the file was already there.

 

Any advise would be greatly appreciated

 

Paul

Share this post


Link to post
Share on other sites

Try reading through this thread. I seem to recall that problem and a fix being posted.

 

Jack

Share this post


Link to post
Share on other sites

Hi Guys.

 

I have error messages :blink:

 

First I had this set of errors

Warning: filesize() [function.filesize]: Stat failed for sitemonitor_log.txt (errno=2 - No such file or directory) in /home/mysite/public_html/store/admin/includes/functions/sitemonitor_functions.php on line 59

 

Warning: opendir(/home/username/public_html) [function.opendir]: failed to open dir: No such file or directory in /home/mysite/public_html/store/admin/includes/functions/sitemonitor_functions.php on line 71

 

Warning: readdir(): supplied argument is not a valid Directory resource in /home/mysite/public_html/store/admin/includes/functions/sitemonitor_functions.php on line 73

Reference file creation failed.

Reading through the above, followed the suggestion of adding an empty file called sitemonitor_log.txt

 

Ran the SiteMonitor again, and got fresh set of error messages as below

Warning: opendir(/home/username/public_html) [function.opendir]: failed to open dir: No such file or directory in /home/mysite/public_html/store/admin/includes/functions/sitemonitor_functions.php on line 71

 

Warning: readdir(): supplied argument is not a valid Directory resource in /home/mysite/public_html/store/admin/includes/functions/sitemonitor_functions.php on line 73

Reference file creation failed.

But hey, I've reduced it to 2 errors, rather than the initial 3 :) So that's positive :)

 

Can anyone give any further guidance please?

 

Thanks in advance for any help.


____________________________________________________________________

____________________________________________________________________

Share this post


Link to post
Share on other sites

I've just tried running sitemonitor.php and get a blank page apart from these error messages

Warning: opendir(/home/username/public_html) [function.opendir]: failed to open dir: No such file or directory in /home/username/public_html/store/admin/includes/functions/sitemonitor_functions.php on line 71

 

Warning: readdir(): supplied argument is not a valid Directory resource in /home/username/public_html/store/admin/includes/functions/sitemonitor_functions.php on line 73

Reference file creation failed.

Just thought I'd post the above as it may help someone help me.

Edited by Harald Ponce de Leon
Edited by request

____________________________________________________________________

____________________________________________________________________

Share this post


Link to post
Share on other sites

Okay, cracked it :D

 

I simply didn't update this line correctly

 

/home/*mysite*/public_html/


____________________________________________________________________

____________________________________________________________________

Share this post


Link to post
Share on other sites

Hi Jack

 

Thanks for this contribution. Works like a charm. Had a bit of troubles setting it up (shared server). Good thing for the forums.

Share this post


Link to post
Share on other sites

when I set up step 6 it show error

 

Warning: filesize(): Stat failed for sitemonitor_log.txt (errno=2 - No such file or directory) in /usr/local/psa/home/vhosts/mp4-ynltd.com/httpdocs/catalog/admin/includes/functions/sitemonitor_functions.php on line 59

 

Warning: opendir(): open_basedir restriction in effect. File(/home/username/public_html) is not within the allowed path(s): (/usr/local/psa/home/vhosts/mp4-ynltd.com/httpdocs:/tmp) in /usr/local/psa/home/vhosts/mp4-ynltd.com/httpdocs/catalog/admin/includes/functions/sitemonitor_functions.php on line 71

 

Warning: opendir(/home/username/public_html): failed to open dir: Operation not permitted in /usr/local/psa/home/vhosts/mp4-ynltd.com/httpdocs/catalog/admin/includes/functions/sitemonitor_functions.php on line 71

 

Warning: readdir(): supplied argument is not a valid Directory resource in /usr/local/psa/home/vhosts/mp4-ynltd.com/httpdocs/catalog/admin/includes/functions/sitemonitor_functions.php on line 73

Reference file creation failed.

 

how to complate

Share this post


Link to post
Share on other sites
when I set up step 6 it show error

 

Warning: filesize(): Stat failed for sitemonitor_log.txt (errno=2 - No such file or directory) in /usr/local/psa/home/vhosts/mp4-ynltd.com/httpdocs/catalog/admin/includes/functions/sitemonitor_functions.php on line 59

 

Warning: opendir(): open_basedir restriction in effect. File(/home/username/public_html) is not within the allowed path(s): (/usr/local/psa/home/vhosts/mp4-ynltd.com/httpdocs:/tmp) in /usr/local/psa/home/vhosts/mp4-ynltd.com/httpdocs/catalog/admin/includes/functions/sitemonitor_functions.php on line 71

 

Warning: opendir(/home/username/public_html): failed to open dir: Operation not permitted in /usr/local/psa/home/vhosts/mp4-ynltd.com/httpdocs/catalog/admin/includes/functions/sitemonitor_functions.php on line 71

 

Warning: readdir(): supplied argument is not a valid Directory resource in /usr/local/psa/home/vhosts/mp4-ynltd.com/httpdocs/catalog/admin/includes/functions/sitemonitor_functions.php on line 73

Reference file creation failed.

 

how to complate

Please read a few posts above yours for the solution.

 

Jack

Share this post


Link to post
Share on other sites

Hello,

 

Can anyone help me with this? I uploaded the latest version of the contrib and get these error messages:

 

Warning: file(/public_html/admin/sitemonitor_configure.php) [function.file]: failed to open stream: No such file or directory in /home/discxpre/public_html/admin/sitemonitor_configure_setup.php on line 160

 

Warning: chmod() [function.chmod]: No such file or directory in /home/discxpre/public_html/admin/includes/functions/sitemonitor_functions.php on line 211

Cannot change the mode of file (/public_html/admin/sitemonitor_configure.php)

 

It seems to me that a path is incorrect. What code to look at?

 

Many thanks.

Share this post


Link to post
Share on other sites

Some host won't allow the permissions to be set by code. Try changing the permissions on the sitemonitor_configure.php file to 666.

 

Jack

Share this post


Link to post
Share on other sites
Some host won't allow the permissions to be set by code. Try changing the permissions on the sitemonitor_configure.php file to 666.

 

Jack

 

Hi Jack,

 

I tried chmoding the file to 0666, but get the same errors. Here's the line of code relating to the errors

 

First error-Line 160 of sitemonitor_configure_setup: $fp = file($filenameConfigure);

 

Second error-Line 211 of sitemonitor_functions: if (!chmod($filename, 0666)) {

 

Everything seems to be working fine except those 2 errors. The admin section of sitemonitor works and I receive the email.

 

To get off topic, just a bit. What you think about creating a logo for this mod just as hackersafe and comodo to display on our Osc stores. This mod serves the same purpose as their product and may be more effective. The only major drawback is the shop owner not checking emails everday. Or better yet, this mod sending a SMS text message. Just a couple of small ideas I needed to run by you before I forget them..

 

Thanks for your help.

Share this post


Link to post
Share on other sites

You could try removing this section of code. But if you do, be sure to test the mod to make sure it is working properly.

  if (!is_writable($filename)) 
 {
 if (!chmod($filename, 0666)) {
	echo "Cannot change the mode of file ($filename)";
	exit;
 }
 }

As for the suggestions, both might be useful to some shops.

 

Jack

Share this post


Link to post
Share on other sites
You could try removing this section of code. But if you do, be sure to test the mod to make sure it is working properly.
  if (!is_writable($filename)) 
 {
 if (!chmod($filename, 0666)) {
	echo "Cannot change the mode of file ($filename)";
	exit;
 }
 }

As for the suggestions, both might be useful to some shops.

 

Jack

 

Thanks for the prompt response. When I removed that section of code, I get these errors:

 

Warning: file(/admin/sitemonitor_configure.php) [function.file]: failed to open stream: No such file or directory in /home/discxpre/public_html/admin/sitemonitor_configure_setup.php on line 160

 

Warning: fopen(/admin/sitemonitor_configure.php) [function.fopen]: failed to open stream: No such file or directory in /home/discxpre/public_html/admin/includes/functions/sitemonitor_functions.php on line 210

 

Warning: fwrite(): supplied argument is not a valid stream resource in /home/discxpre/public_html/admin/includes/functions/sitemonitor_functions.php on line 220

Cannot write to file (/admin/sitemonitor_configure.php)

 

I believe it's something in the code that comes before the error codes. I'll replace the code for now until the situation is resolved.

Share this post


Link to post
Share on other sites

If the file is actually there, then your host is preventing the operation. You would need to ask them. Although they will probably ell you they don't support third-party applications.

 

Jack

Share this post


Link to post
Share on other sites
If the file is actually there, then your host is preventing the operation. You would need to ask them. Although they will probably ell you they don't support third-party applications.

 

Jack

 

Jack,

 

I contacted the host. The only conclusion they come up with is to put in a support ticket. I temporarily disabled the password protection to see if that caused the confusion, no luck. What permissions do i need to set and on which files? Or do I need to correct the first problem first?

Share this post


Link to post
Share on other sites

It shouldn't require any special permissions though that would depend on the server. You need to be able to write to a file on the server and that is what's failing, as best as I can tell from here.

 

Jack

Edited by Jack_mcs

Share this post


Link to post
Share on other sites
It shouldn't require any special permissions though that would depend on the server. You need to be able to write to a file on the server and that is what's failing, as best as I can tell from here.

 

Jack

 

Jack,

 

Thanks for all your help. I've tried all the chmoding options that I know of 444, 666, 755, 777. Still no luck. I did change how the path is called in admin/includes/configure.php to get rid of double slashes in the file path. I may have disturbed something there that I should have not tampered with. What code should I look at in admin/includes/configure.php and possible changes to be made?

 

Everything seems to be in working order. I've performed all tasks as prescribed in the instructions except the cron job. It told me that alterations that were made to certain files that I made changes to and to the google sitemap files (Googlebot may have crawled my site). So, it's working fine. I just hope those errors hasn't caused any vunerability to the scanned files.

Share this post


Link to post
Share on other sites

Try this. Make a copy of your sitemonitor_configure.php file and name it testfile.php. Then create a new file, copy the following into it and save it as test.php

<?php
 require('includes/application_top.php');
 require('includes/functions/sitemonitor_functions.php');
 $filenameConfigure = DIR_FS_ADMIN . 'testfile.php';

 $fp_out = array();
 $fp_out[] = 'test';
 WriteConfigureFile($filenameConfigure, $fp_out);
?>

Upload both file into your admin section and go to http://yoursite.com/admin/test.php. If it fails, it is something on your server.

 

Jack

Share this post


Link to post
Share on other sites
Try this. Make a copy of your sitemonitor_configure.php file and name it testfile.php. Then create a new file, copy the following into it and save it as test.php
<?php
 require('includes/application_top.php');
 require('includes/functions/sitemonitor_functions.php');
 $filenameConfigure = DIR_FS_ADMIN . 'testfile.php';

 $fp_out = array();
 $fp_out[] = 'test';
 WriteConfigureFile($filenameConfigure, $fp_out);
?>

Upload both file into your admin section and go to http://yoursite.com/admin/test.php. If it fails, it is something on your server.

 

Jack

 

Jack,

 

After trying that, I only get this error:

 

Warning: chmod() [function.chmod]: No such file or directory in /home/discxpre/public_html/admin/includes/functions/sitemonitor_functions.php on line 211

Cannot change the mode of file (/public_html//admin/testfile.php)

 

Notice the double slashes after public_html in the above line. So how do I approach this problem with my host? Or what changes within admin/includes/configure.php should I make?

 

Thanks.

Share this post


Link to post
Share on other sites

The double slash is most likely a configure file problem. It shouldn't make a difference but given that the code doesn't work, it has to be fixed first. If the script still fails, there is a problem on your server since all that does is tries to write a file to disk.

 

Jack

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×