Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9251099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:36:42+00:00 2026-06-18T10:36:42+00:00

i am running a php+mysql site on a lamp ubuntu cloud server (amazon ec2).

  • 0

i am running a php+mysql site on a lamp ubuntu cloud server (amazon ec2). i use php sessions.

for every session (SID), i need to create a temporary folder which is a subdirectory of www and has the session Id as its name (unpredictable, therefore cannot be pre-created). for example: /var/www/fileStore/s35S10nT3Mp/.

i will later access files in these folders from a javascript (client side) function.

i am working under the assumptions that:

  1. anything executed (or called) by the php code will run under the user www-data (apache php user)
  2. client-side javascript cannot access a subdirectory OUTSIDE www (for example: /var/outsideFileStore/s35S10nT3Mp/, where webroot = public_html = /var/www)

i have a security issue with giving user www-data write permissions in a subdirectory of www, because that leaves the server and data in these folders too exposed.

i would like to know if a php session can trigger (or call) a server script / process that runs under another user (who would receive write permission in /var/www/fileStore/), not www-data. this process would then create (and garbage collect) these temporary folders.

corollary: in case this cannot be done under apache, would tomcat help (if i ran php under java as opposed to http_server)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T10:36:43+00:00Added an answer on June 18, 2026 at 10:36 am

    You could compile an executable with the identity bit, owned by this alternate user. The PHP script would exec this program, which in turn could simply run the actual PHP script of your choice.

    The program could be written in Perl as well — it’s the only scripting language that Linux systems permit to have the identity bit.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Alright, I got an Apache localhost server up and running with PHP and MySql.
I'm running a MySql and PHP driven blog/comment styled site, and want to make
I have a site running a Linux/Apache/MySQL/PHP stack. I would like to connect to
First things first. I'm running CodeIgniter on a PHP/MySQL site. I've been tasked with
My MySQL Server (running with PHP via PDO on Windows 2008 Server) returns error
I have the following mysql query which I am running with php like so.
Running PHP debug session in Netbeans always opens as a new tab in browser
My server is running php and I want it to be able to send
We have a server running PHP 4.3.9 with safe_mode ON and safe_mode_exec_dir setted to
We are running PHP on a Windows server (a source of many problems indeed,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.