Can there be in whatever way to create Apache to see PHP documents from RAM?

I am considering developing a virtual disk within the memory after which modify httpd.conf to alter the document root directory towards the virtual disk within the memory.

Is viable?

Essentially, what I wish to do is distribute my PHP code to my users' computer systems to allow them to run it. But I'm not going these to have the ability to consider the PHP source code easily - the code can not be saved within the harddisk in plain text, rather, they're saved inside a computer file after which read by my program in to the memory where Apache reads it.

Is viable? Could it be easy to produce a virtual disk in memory in C++ the virtual disk can not be utilized by every other means for example My Computer?

Update:

Thanks all for that questions which may assist me to better percept my goals, however i think I understand what I am doing. Please just suggest any solutions you might have towarding me.

Hard part so far is perfect for Apache to see from somewhere apart from an ordinary directory within the harddisk that consists of all of the source code of my project. I wish it to be as hidden as you possibly can. I understand just a little about home windows desktop development and thought virtual disk may well be a solution but when you've better ones, please suggest.

You are able to, theoretically, have Apache serve files from a Samba share. You should configure the server to mount a particular file share produced by the consumer. This will not work when the user is behind a firewall or NAT gateway associated with a variety.

This is:

  • Reduced than molasses in The month of january ... in Alaska. Apache does a lot of stat calls on each request automatically. This will add lots of overhead before even locating the file, moving it over, after which performing it.
  • Difficult to configure. Adding mounts is really a non-trivial task in the server level and Samba could be rather finicky on sides. Further, if you work with RHEL/CentOS or other distro running SELinux, you are going to need to perform the chcon/setsebool tapdance to even have it working. The default configurations specifically stop Apache from touching any file that found the machine via a Samba share.
  • A burglar nightmare. You'll be permitting Apache for everyone up files to anybody from the computer that's not beneath your direct control. The malicious options are endless. This can be a horrible idea that you ought to not you should consider.

A safer-but-still-insane alternative may be available. FastCGI. The remote systems can operate a FastCGI process and really host and execute the code directly. Apache could be set up to pass through PHP demands towards the remote FastCGI process. This can still break when the customers are firewalled or NATted. This are only a suitable solution when the user can really operate a FastCGI process and also you don't mind the code really performing on their system rather than the server.

It has the distinct benefit of the files not performing poor the server.


Possibly I have entirely misinterpreted -- are you currently requesting code to become run live from user's systems? Because I authored this answer under that interpretation.