473,657 Members | 2,579 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to Find out the current USER/GROUP of the php script

103 New Member
Hi

I am trying to debug an upload script and I need to know what the user/group is of the php-script that's running.

My problem is that the webserver settings have '48' as the user/group - presumably 48 means httpd. But when I upload files through PHP, they are moved from the temp folder and the permissions are 744 with the owner as '48'. This means I can't change the file in FTP/SSH.

I am trying to make a script to chmod() the files but the script doesn't do anything and I think it is because the script uses my username, not httpd, but I want to check.

If you have a solution for the bigger problem, amazing. Otherwise, the intermediary one - knowing the PHP script's user/group would be great.

Thanks!

Henry
Nov 10 '10 #1
2 2695
dlite922
1,584 Recognized Expert Top Contributor
If you're using httpd (apache) then PHP has nothing to do with User/Group. It's apache that's configured to use a specific user/group.

What's the bigger problem? Why can't you access a file using FTP? if the default permissions are 744. This means it can be read by anybody (any user on the server).

Dan
Nov 16 '10 #2
henryrhenryr
103 New Member
Hi Dan

Thanks for the reply. I've been away for a while.

My guess is that when the file is uploaded it goes into the temp folder and is owned by '48' - the httpd user. When the PHP script then transfers it to the relevant folder in the web-root, it the owner is not changed.

I have attempted to 'chown' using a PHP script but that doesn't work - this is why I want to determine the current user/group of the running script - just to see if it is 48 and the problem must be solved in another way. I can't work out why my script to 'chown' won't work but the upload script is able to upload as user '48'.

I need the permissions to be r/w/x so I can delete the files if necessary. Yes, it doesn't cause immediate problems to the application as it is readable like you say.
Nov 23 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

12
2800
by: Google Mike | last post by:
You know, while working on my moonlight corporation's LAMP project at home this weekend, I couldn't help but wonder if people writing similar projects are solving similar problems with having to complete the project by building an installer and building the user/group administration piece of it. The thought came to me that it would be great if LAMP developers, whether they used MySQL or PostgreSQL, could just simply write the project to...
4
2855
by: Victor | last post by:
Hi all I greatly appreciate your time and help if possible. I'm currently using User.IsInRole("Group_name") to find out if the logged in user belongs to a certain NT User Group. For some reason I can do this only in the .aspx form and not in a class. I would like to write a function in a common .vb class that can call the WinNT local users and find out if current user belongs to a certain group. Thanks for your help. V
2
1646
by: aj | last post by:
DB2 WSE LUW 8.1 FP5 Red Hat AS 2.1 I would like to grant a new database user the same privileges (across many tables and views) that a current user has. Rather than doing it by hand, might anyone have a script that automates this? TIA
0
1408
by: cameron | last post by:
I need to find a user's memberOf list, (and all nested groups), very quickly. My current method is to iterate through the the results of the the MemberOf property and then do the same to each of those groups. While complete, this is painfully, painfully, (grow old and die before it is done), slow. I have looked at the m_role attribute of the princible object: WindowsPrincipal MyPrincipal = new WindowsPrincipal(UserIdentity);...
0
318
by: cameron | last post by:
I need to find a user's memberOf list, (and all nested groups), very quickly. My current method is to iterate through the the results of the the MemberOf property and then do the same to each of those groups. While complete, this is painfully, painfully, (grow old and die before it is done), slow. I have looked at the m_role attribute of the princible object: WindowsPrincipal MyPrincipal = new WindowsPrincipal(UserIdentity);...
2
1553
by: Bob | last post by:
I am developing an ASP.NET application that needs to archive documents and support the retrieval of them. When the document is stored, the user needs to be able to indicate whether it is a public document or limited to a group/class of users. Search/retrieval must only return the result set that the current user is permitted to see. What is the best mechanism (assuming IIS and SQL Server with Windows Authentication setup) for supporting...
0
1763
by: dsartain | last post by:
Hi, I'm trying to use C++.NET to find which user is currently logged in. This is part of a bigger project for which I'll also need to retrieve visited URL's from the web browser as well...but one thing at a time I guess. I'm trying to use the windowsIdentity function to get the name...but I can't get the syntax right here's the little I've been able to figure out from the MSDN library... // This is the main project file for VC++...
2
7098
by: Abraham Andres Luna | last post by:
hello everyone, does anyone know why i can't access the HttpContext.Current.User.Identity.Name property in a .cs file? this is the index.aspx page: <%@ Page Language="C#" %> <script runat="server"> void Page_Load(Object Sender, EventArgs E) {
5
5531
by: TravisTurman | last post by:
I'm a C# newbie and have inherited a program that runs at login. Part of the program looks at a text file to see which version is installed and then installs the latest greatest version if needed. In order for this to work, the person logging into the Windows XP desktop needs to have local admin rights on the machine. Is there a way using C# to give the current user the necessary rights, or put them in the local administrators group,...
0
867
by: exodus | last post by:
best name I could come up with, but I'm open to suggestions :) current site: http://sypug.blogspot.com/ irc: irc://irc.p2p-network.net/sypug I could only find one other SoCal python user group, and the members seemed more adult, job oriented (one of the guys had worked at Disney already..). Don't get me wrong -- power to the guys making moves in the python world! -- but I don't think I'd fit in. I've been playing with Python for a...
0
8305
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8823
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8730
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7321
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4151
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1607
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.