Koozali.org: home of the SME Server

php question

Offline Agent86

  • *****
  • 592
  • +0/-0
    • http://www.iclbiz.com
php question
« on: May 14, 2006, 03:11:35 AM »
Hi all

Sorry for the double post, but I thin the other posts were related to other subjects, but not directly addressing this subject so I have sort of duplicated this questions a few times in the forums; I do appologize about that.

Anyhow regarding php scripts in general and how sme might handle them?

I'm confused about php

I only see the cgi-bin I'm told to install my php files there so I did
Anyhow my question is, does sme allow the php script to create folders and set permissions to these folders? or not ?

Basically I'm having problems with my auction site which should be working fine, but i'm told that there is some problem with either the ftp portion, or the server not allowing the script to set the permissions or create the user folders.

I've got the server set correctly and have followed all the instructions. All other aspects of SME 7 appears to work perfectly.

Thanks for any help on this subject.

duncan

php question
« Reply #1 on: May 14, 2006, 05:47:23 AM »
Im not sure about cgi-bin but definatley yes under the html folder. File ownership needs to be www as that is what apache runs under.

Offline Agent86

  • *****
  • 592
  • +0/-0
    • http://www.iclbiz.com
Please clarify
« Reply #2 on: May 14, 2006, 06:00:33 AM »
Hi thanks for the reply

Please clarrify, www

duncan

php question
« Reply #3 on: May 14, 2006, 06:13:27 AM »
If you do a
Code: [Select]
ls -la
 in the directory you will see a group of permissions for the various files and folders.

You might need to change the ownership of the folder that the web server needs to modify to www.

ie
Code: [Select]
chown www.www foldername

Just be careful when changing permissions.

Offline raem

  • *
  • 3,972
  • +4/-0
Re: Please clarify
« Reply #4 on: May 14, 2006, 02:21:51 PM »
Agent86

> Please clarrify, www

If you need clarification then you should really be reading some reference material so that you understand better.
Search google for
linux file permissions
and
linux file ownership

If you set the wrong permisions and ownership then you risk getting your server hacked, so be careful.
Make sure you understand the full effect of any changes you make.
...

Offline Agent86

  • *****
  • 592
  • +0/-0
    • http://www.iclbiz.com
huh ?
« Reply #5 on: May 14, 2006, 05:52:23 PM »
If permissions are set to 777 does the ownership really matter ?

I understand pointing to the references, however this does not really address the question. Knowing the answer and having to set this ownership indicates that sme is not allowing the php sript to write or set permissions as needed.

So if I understand your answer, you saying yes, and that I need to change the file permissions and ownership so that the script will allow this.

Is it typical to have to change ownerships of files or folders when running a php script on SME

Please advise
Thanks all

Offline raem

  • *
  • 3,972
  • +4/-0
Re: huh ?
« Reply #6 on: May 14, 2006, 06:07:18 PM »
Agent86

> If permissions are set to 777 does the ownership really matter ?

That is a dangerous thing to do in most circumstances.
You would only do that temporarily while writing to a configuration.php file or similar and then set it back to 644.

> I understand pointing to the references...

No I don't think you do. You want a magic answer and your statements here indicate you do not really understand the issues of ownership, permisssions and web & php scripts.
I suggest you read the reference material carefully and work it out.
...

Offline Agent86

  • *****
  • 592
  • +0/-0
    • http://www.iclbiz.com
Well now what
« Reply #7 on: May 14, 2006, 11:26:05 PM »
You are correct regarding my knowledge of why a php script or folder would have to get a particular ownership setting. I don't really know? Thats the question?

My limited knowledge is not relevent since this script works on most other server, windows or unix/linux

What is making SME different, and why would my install process be so much different?

I'm not disregarding the possibility that I may have to change ownership of the folder/files etc.

I just want to be sure that before I just jump through hoops or go thru the excercise that I am sure of what the problem actually is and can determine if this is a SME topic, simple file permission,ownership or other problem.

So these questions that I'm asking are very specific to know if SME would not allow a php script to create a user folder, or set permissions as the script is designed to do, and what might cause SME to do this?

If the answer is yes it could and this can be fixed or changed with the setting of proper ownership then I will certainly research the information as I normally do.

But, I'm not sure I need to understand all those things to have this question answered necessarily and perhaps someone who does actually know this answer can simple say yes SME does not allow this by default, or no it must be something else.

This topic is not even necessary to research on other servers. Simply install the cgi-bin files via asci, and the html file via binary upload and set the permission and it just works perfect no need for any other ownership settings etc.So what makes SME different is my question. Why would I have to learn such things, and will this actually solve the problem. Or is this just a simple read more research more advice and let us know how it turns out type of thing.

I've had several programmers look at this and do not know why the script will not write or set permission on my server it works perfect every where else.

I've been told it's my server, not the script, so I will research and adjust the ownership of the folder and post my findings

Thanks for the tips and I hope your right.

Offline Agent86

  • *****
  • 592
  • +0/-0
    • http://www.iclbiz.com
Thanks for the advice
« Reply #8 on: May 15, 2006, 12:00:21 AM »
Well, I've actually set all the files and folders in my primary ibay to www.www to see what may happen just to see if it would solve any of this.

To conclude no effect the php script will does not seem to write or set permission.

I've set the ownership to www. and the permissions for all folders to 777 and the script does not work on SME for some reason.

I'ts possible it's just a simple compatibility issue, however I've made sure that sme has the required php etc to run the script.

And I just cannot get this working

Offline kruhm

  • *
  • 680
  • +0/-0
php question
« Reply #9 on: May 15, 2006, 06:03:22 AM »
it's also possible that you're "confused about php"

Offline raem

  • *
  • 3,972
  • +4/-0
Re: Thanks for the advice
« Reply #10 on: May 15, 2006, 09:26:46 AM »
Agent86

You have told us nothing about the php scripts, what they do, etc, whether you are trying to configure something initially or want long term web user control (read & write) etc.
How do you expect us to advise on something we don't even know about.
You need to be more specific.

Personally I would put the php scripts in the html folder, not the cgi-bin (which is for scripts of that type).
...

Offline Agent86

  • *****
  • 592
  • +0/-0
    • http://www.iclbiz.com
You are right
« Reply #11 on: May 15, 2006, 02:47:16 PM »
I am confused about php, however those who have installed it are not confused, and have installed it as they would any other server, and I would be happy to tell you all about the script, but this script has been evaluated, and I'm told the server is not allowing the script to set permissions to the new user folders that are getting added.

Basically it's an auction site, and the script is almost functional, however when a user registeres, and then attempts to add a new item listing, the listing shows up as (1) item added to that category, but when you browse to that category the item is not there.

I'm told that adding the new listing completed, however the script cannot create the proper user folder, or set the permissions for that folder.

Here is the script and here is the site:
ftp://cyberspace@foolishlys.com/  it's a zip file no password needed

And the site is:
www.foolishlys.com

duncan

php question
« Reply #12 on: May 16, 2006, 01:23:44 AM »
As far as I can see - this package makes no use of php.

Offline raem

  • *
  • 3,972
  • +4/-0
Re: You are right
« Reply #13 on: May 16, 2006, 04:06:33 AM »
Agent86

The log files should tell you exactly what is and is not happening.
Have you looked, ie at http error log files etc.

Perform one of the problematic functions and then review the log files to see the error.
...

Offline Agent86

  • *****
  • 592
  • +0/-0
    • http://www.iclbiz.com
Thanks for the tips
« Reply #14 on: May 16, 2006, 02:14:14 PM »
Thanks

It is a php script, I'll will do some basic functions on the website and then post those logs which shows some things like:

[client 66.xxx.xxx.x6] script '/home/e-smith/files/ibays/Primary/html/xmlrpc.php' not found or unable to stat

[client 66.xxx.xx7.x6] script '/home/e-smith/files/ibays/Primary/html/adxmlrpc.php' not found or unable to stat

[client 220.xxx.xxx.x33] script '/home/e-smith/files/ibays/Primary/html/index.php

And things like that

I'll go thru some processes on the site and then post the logs once I've done that

thanks all