PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 16th, 2012, 12:11 AM
Kevin Gordon Kevin Gordon is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 3 Kevin Gordon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 26 m 14 sec
Reputation Power: 0
PHP-General - PHP Script - access denied

Hi,

I have been developing a website which runs ok on my laptop. I have now put it online but have hit a problem.

When my site loads a javascript function calls a php file to create a list of values from the database. That works fine. When the same file is subsequently called from the same javascript function to refresh the list of values I get a 'Forbidden You don't have permission to access... updateTimes.php.'

First, I changed all file permissions to 755. Same problem. Then I moved all php files out of the public_html directory and created a new php file 'submitProcess.php' to which the name of the particular file to be run is passed as a parameter. I get the same error message in the same situations as before - telling me now that I do not have access to submitProcess.php, but this depends on which particular script is being called from submitProcess, and on whether it is called on load or by a subsequent call to the same file.

I am confused and do not know what else to try or where to look.

Kevin

Reply With Quote
  #2  
Old November 16th, 2012, 07:06 AM
gw1500se gw1500se is offline
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jul 2003
Posts: 2,867 gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 1 Year 1 Week 5 Days 9 h 6 m 6 sec
Reputation Power: 581
Your description is a bit confusing. You mention javascript which is client side and then PHP which it server side. Are you using Ajax or is your javascript loading a PHP page? Either way it has nothing to do with javascript per se. It is difficult to debug permissions problems without looking at the actual OS directory tree. The error you describe indicates a problem with updateTimes.php so messing with all the other files is just confusing the issue. Look at that file and see how it is different with respect to ownership, permissions and possibly path from all the rest.
__________________
There are 10 kinds of people in the world. Those that understand binary and those that don't.

Reply With Quote
  #3  
Old November 16th, 2012, 07:38 AM
Kevin Gordon Kevin Gordon is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 3 Kevin Gordon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 26 m 14 sec
Reputation Power: 0
To clarify:

Yes, Ajax, to be specific. As javascript is client side it can only access files in public_html. There is only one php file in public_html, namely submitProcess.php (other than index.php). Therefore I know all php files must be called via submitProcess.php, as only php and not javascript can access the other php files.

However, when I get an error message it refers to submitProcess.php, telling me I don't have permission to access it. But some processes run, and updateTimes runs successfully on load (as stated, necessarily via a call to submitProcess).

May I assume then that the error message does not necessarily mean what it says and that the problem may be within the php file being called and that it may not be a problem with permissions?

Reply With Quote
  #4  
Old November 16th, 2012, 07:50 AM
gw1500se gw1500se is offline
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jul 2003
Posts: 2,867 gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 1 Year 1 Week 5 Days 9 h 6 m 6 sec
Reputation Power: 581
What user is running submitProcess.php, when called via Ajax? Assuming it is apache, does that user or its group have rx permissions on updateTimes.php?

Reply With Quote
  #5  
Old November 16th, 2012, 08:44 AM
E-Oreo's Avatar
E-Oreo E-Oreo is offline
Lost in code
Click here for more information.
 
Join Date: Dec 2004
Posts: 7,930 E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)  Folding Points: 945 Folding Title: Novice Folder
Time spent in forums: 2 Months 7 h 39 m 37 sec
Reputation Power: 6991
Copy and paste the exact and full error message that you're getting.

Is the error message being thrown by JavaScript? Or is it being returned in the HTTP response for the page? What is the status code returned in the HTTP request?
__________________
PHP FAQ
How to program a basic, secure login system using PHP

Quote:
Originally Posted by Spad
Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around

Reply With Quote
  #6  
Old November 17th, 2012, 03:36 AM
Kevin Gordon Kevin Gordon is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 3 Kevin Gordon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 26 m 14 sec
Reputation Power: 0
This is solved, although in the end it had nothing to do with file permissions. There was an undefined parameter being passed to the procedure and correcting that seems to have solved the matter.

Kevin

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > PHP-General - PHP Script - access denied

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap