Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Checking File Permissions


Recommended Posts

Do you want to check the file and directory permissions on your server match those specified in the post installation instructions in the knowledgebase?

 

You can run this feature in 2 modes. Check and Update. One shows what would be done if the permissions, which you can set on the screen, are applied and the other shows the changes actually made.

 

It is possible that your server will throw 500 "Internal Server Error" if you set the permissions to values they do not like. As you get a display of all the changes made, make sure you test your site before you leave the results page. (You can set everything back.)

 

Sometimes you can get this when you upload files for a contribution.

 

Being paranoid, I recommend you back up you site content to your pc using an ftp client before playing around with permissions.

 

Also it would be good if you know how to change permissions from your ISP's control panel and using an ftp client such as filezilla.

 

Now available from http://addons.oscommerce.com/info/6134

Edited by geoffreywalton

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

  • Replies 71
  • Created
  • Last Reply

Top Posters In This Topic

it seems to be a terrific tool , it can save hours !!!

let me thank you :-)

 

im gonna test it now

 

for the chmod , how to know for sure the official chmod required and advised ?

 

by the way don't forget to look at this contribtuion who has the same goal http://www.oscommerce.com/community/contributions,2137

it s more graphic but go less deeper !

MS2

Link to comment
Share on other sites

  • 4 months later...

Hi,

 

I have a couple of problems with the contribution and wondered if anyone could help?

 

Firstly before the file checking starts I get this line:

 

Set Standard File And Directory Permissions

 

**Permission check in progress (no changes will be made).**

 

The directory backups exists, so this is OK.

 

The admin directory is called shop

 

Type Name Original permissions Actions / Results

Warning: chdir() [function.chdir]: No such file or directory (errno 2) in /homepages/nn/dnnnnnnnnn/htdocs/shop/admin/check_permissions.php on line 360

File ./account.php 755 Action Required, should be

File ./stylesheet.css 755 Action Required, should be

Directory ./images 755 Action Required, should be

File ./account_edit.php 755 Action Required, should be

 

Then runs OK for a while until this:

 

File ./images/default/Thumbs.db 755 Action Required, should be

File ./images/banners/oscommerce.gif 755 Action Required, should be

File ./images/banners/Thumbs.db 755 Action Required, should be

 

1146 - Table 'dbnnnnnnnnn.TABLE_COUNTER' doesn't exist

 

select startdate, counter from TABLE_COUNTER

 

 

Now table COUNTER doesn't exist, table counter (lower case does)

So I added the table but still received the error?

 

Any help much appreciated.

Link to comment
Share on other sites

What version of osc are you using?

 

G

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

That line is looking for an entry for TABLE_COUNTER in /includes/database_tables.php.

 

The only place it is called is from the standard footer in the shop, in the rc2a version, not the admin area, so am a little confused as to why it is being called from a php file the admin area.

 

Have you copied the shop footer.php to /admin?

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

  • 2 weeks later...

i am getting the same thing with my install of MNK Edition based off osCommerce 2.2 rc2a this mod is pre installed with the MNK version

thanks

Jeff

 

 

 

 

Hi,

 

I have a couple of problems with the contribution and wondered if anyone could help?

 

Firstly before the file checking starts I get this line:

 

Set Standard File And Directory Permissions

 

**Permission check in progress (no changes will be made).**

 

The directory backups exists, so this is OK.

 

The admin directory is called shop

 

Type Name Original permissions Actions / Results

Warning: chdir() [function.chdir]: No such file or directory (errno 2) in /homepages/nn/dnnnnnnnnn/htdocs/shop/admin/check_permissions.php on line 360

File ./account.php 755 Action Required, should be

File ./stylesheet.css 755 Action Required, should be

Directory ./images 755 Action Required, should be

File ./account_edit.php 755 Action Required, should be

 

Then runs OK for a while until this:

 

File ./images/default/Thumbs.db 755 Action Required, should be

File ./images/banners/oscommerce.gif 755 Action Required, should be

File ./images/banners/Thumbs.db 755 Action Required, should be

 

1146 - Table 'dbnnnnnnnnn.TABLE_COUNTER' doesn't exist

 

select startdate, counter from TABLE_COUNTER

 

 

Now table COUNTER doesn't exist, table counter (lower case does)

So I added the table but still received the error?

 

Any help much appreciated.

[/quote

Link to comment
Share on other sites

i copyed the footer.php to admin and it helped the top message is now gone Warning: chdir() [function.chdir]: No such file or directory (errno 2) in /homepages/nn/dnnnnnnnnn/htdocs/shop/admin/check_permissions.php on line 360 the only thing that was different was the url address i copyed he message to make the post quick

 

 

 

this one is still their

1146 - Table 'projedd1_mnkosc.TABLE_COUNTER' doesn't exist

 

select startdate, counter from TABLE_COUNTER

 

[TEP STOP]

 

this is at bottom of the page after u click on the check permissions

Edited by projectpb
Link to comment
Share on other sites

The admin/includes/footer.php should be as follows

 

<?php
/*
 $Id: footer.php,v 1.12 2003/02/17 16:54:12 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/
?>
<br>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
 <tr>
<td align="center" class="smallText">
<?php
/*
 The following copyright announcement is in compliance
 to section 2c of the GNU General Public License, and
 thus can not be removed, or can only be modified
 appropriately.

 For more information please read the osCommerce
 Copyright Policy at:

 http://www.oscommerce.com/about/copyright

 Please leave this comment intact together with the
 following copyright announcement.
*/
?>
E-Commerce Engine Copyright © 2005 <a href="http://www.oscommerce.com" target="_blank">osCommerce</a><br>
osCommerce provides no warranty and is redistributable under the <a href="http://www.fsf.org/licenses/gpl.txt" target="_blank">GNU General Public License</a>
</td>
 </tr>
 <tr>
<td><?php echo tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', '', '1', '5'); ?></td>
 </tr>
 <tr>
<td align="center" class="smallText">Powered by <a href="http://www.oscommerce.com" target="_blank">osCommerce</a></td>
 </tr>
</table>

 

If you copy the footer from the shop you will get the error because the counter table is not defined in database_tables.php. Either put the correct footer back or define it in the tables file.

 

Might be a good idea to contact your template provider and point out their error.

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

Apologies for the late reply due to Xmas and New Year. By the way Happy New Year!

 

I checked and footer.php in the admin area is exactly the same as it is in your example.

 

I too am using a template (never again!) so perhaps there is something in there that is causing the problem?

 

I am still getting:

1146 - Table 'db266941211.TABLE_COUNTER' doesn't exist

 

select startdate, counter from TABLE_COUNTER

 

[TEP STOP]

 

Anythink else that needs to be checked?

Link to comment
Share on other sites

No, somewhere you have a reference to a table that is not listed as a files that the admin area can access (see file in admin/includes).

 

The offending code is probably

 

require(DIR_WS_INCLUDES . 'counter.php');

 

which refers to the script /includes/counter.php

 

G

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

  • 1 month later...

Should be to /admin/includes/footer.php

 

Try changing line 541 of check_permissions.php from....

 

<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>

 

 

to

 

<?php //require(DIR_WS_INCLUDES . 'footer.php'); ?>

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

Hi Geoffrey Walton,

 

Do you have an additional configuration file which allow files or folders to be added from the Admin panel onto the Check File Permissions mod, instead of modify from the php file?

 

Thanks!

Edited by lightshine
Link to comment
Share on other sites

Hi Geoffrey Walton,

 

Do you have an additional configuration file which allow files or folders to be added from the Admin panel onto the Check File Permissions mod, instead of modify from the php file?

 

Thanks!

 

no, which files and folders are missing?

 

G

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

I would lilke to say thank you to Geoffrey Walton for the contribution which is very useful.

 

Very clear instruction, easy to follow.

 

Now can control file and folder permission easily and safe a lot of time.

 

Once again thanks Geoffrey for the good work.

 

GOD Bless you.

Link to comment
Share on other sites

no, which files and folders are missing?

 

G

Nothing is missing but if we need to add in our own files and folders, the admin panel setting side for the check permission would be useful. We wouldn't want to mess around with the php file for the contribution, hope you understood what i meant.

Just my 2 cents worth of thoughts and thanks for the great contribution!

Link to comment
Share on other sites

  • 3 weeks later...

Hi. This is a great, and easy to run/install, contribution.

 

I put it in a rc2a system and had one minor problem:

 

Warning: chmod() [function.chmod]: Operation not permitted in /home/jwewbro1/public_html/admin/check_permissions.php on line 326

 

						if (!$testrun) {

						if(substr($current_file,-3,3) == 'bak'){
							unlink($path);
						} else {
							switch ($correct_mod) {
								case 777:					
									$ch = chmod($current_file, 0777);
									break;
								case 755:
									$ch = chmod($current_file, 0755);
									break;
								case 744:					
									$ch = chmod($current_file, 0744);
									break;
								case 644:					
THIS IS LINE 326									$ch = chmod($current_file, 0644);
									break;
								case 444:
									$ch = chmod($current_file, 0444);
									break;
								case 440:
									$ch = chmod($current_file, 0440);
									break;
								case 400:
									$ch = chmod($current_file, 0400);
									break;							
								default:
									$ch = chmod($current_file, 0644);
							}
//								if ($ch ){echo '<br>ok '.$current_file; }else{echo '<br>ohoh '.$current_file;}
						}
					}

					echo "<tr>
						<td>File</td>
						<td>" . $current_file . "</td>
						<td>" . decoct($mode) . "</td>
						<td>" . ((decoct($mode)==$correct_mod) ? "OK" : (($testrun) ? "Action Required, should be  " . $correct_mod : ($ch ? "Updated to " . $correct_mod : "Update failed"))) . "</td>
					</tr>";

				  } // if if_dir
if ($i > 5000) {
break;
}

 

It looks like everything worked. I ran a check with the same 644/755 values and it checked out. Also, on CPANEL.

Is there a way to eliminate the error message?

 

Let me know.

Once again, great mod!

Link to comment
Share on other sites

For some reason your configuration on the server is not letting you change the permissions on a file to 644.

 

Have a look at the directory permissions the file is in and the file permissions.

 

Glad you found it of use.

 

G

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

For some reason your configuration on the server is not letting you change the permissions on a file to 644.

 

Have a look at the directory permissions the file is in and the file permissions.

 

Glad you found it of use.

 

G

 

Thanks, I'll dig around in there.

Link to comment
Share on other sites

Found a bit missing as well... look in the admin\check_permissions.php file for:

 

$backup = $_POST['backup'];

$temp = $_POST['temp'];

 

and put in the middle line to make it:

 

$backup = $_POST['backup'];

$download = $_POST['download'];

$temp = $_POST['temp'];

 

Which should make it so that running this doesn't kill your downloads folder anymore. Noticed that it couldn't set the permissions on the file partway through.

Link to comment
Share on other sites

What are the current permissions on the file?

 

Do you have permissions sufficient to change the permissions?

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

>>What are the current permissions on the file?

 

the php file itself got even 777 for testing purposes.

 

>>Do you have permissions sufficient to change the permissions?

 

well, using FTP, sure, but I am not sure how to verify if the PHP engine is allowed to use chmod , may that be the issue ?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...