473,795 Members | 2,863 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

uploading to /home/*/public_html on a linux box

Perhaps this is an apache server question, rather than a php
question. But I want to use a simple php upload script in
a user-home-sub-document-root dir on a standard linux box.

If php is a mod.so it is the apache process that does the
uploading, so it cannot upload into a directory that belongs
to "username" unless the file permissions are 777,
or perhaps......so me way to use group permissions that
allows the apache process to write to a directory whose
group bit is readable and writable.

I tried creating a new group definition in /etc/group
and then made the apache pseudo user a member, as well
as a test user, and then set the directory permission
on that user's public_html directory to 775

But the upload process still throws an error message.
There must be a way to do this, without setting the dir
permission to 777
Is running php as a cgi and then wading through all the
suexec pitfalls the only alternative to 777 permissions?

Jun 2 '08
11 2067
.....the whileone c-code works for me.
I'm not on a shared host. With that code
I get a file uploaded and copied to /home/username/public_html
that belongs to username. That's what I wanted.
Jun 2 '08 #11
salmobytes wrote:
....the whileone c-code works for me.
I'm not on a shared host. With that code
I get a file uploaded and copied to /home/username/public_html
that belongs to username. That's what I wanted.
Which, since you own the site, you could have done with PHP, also.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===

Jun 2 '08 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
4472
by: Ralph Freshour | last post by:
I'm trying to code the ability for my users to upload up to photo's to mysql database - can someone point me in the right direction as to how this might be done in php? Perhaps a tutorial or some code samples? My two php books don't cover uploading photo's to a web site. Thanks...
0
1322
by: -Jim | last post by:
I've been looking for a solution for this for a bit... I decided to just try and copy and paste the solution from php.net to try and still nothing. //theUpload.php <?php echo"<form enctype=\"multipart/form-data\" action=\"result.php\" method=\"post\">"; echo" <input type=\"hidden\" name=\"MAX_FILE_SIZE\"
7
8670
by: Roger Withnell | last post by:
I would like to check that an image file, selected by a user using fileUpload, is within certain parameters (width, height, filesize) and to display the image file so that the user can see the correct image has been chosen, before uploading it to the server. http://www.your-community.co.uk/TestImageArray.asp is an extract of the basic functions which work in IE but not in NN (the alerts are just tests to see what is going on). It...
1
1239
by: monomaniac21 | last post by:
Hi all when using a very simple upload script that I know has worked in the past i get this errror on a server: Warning: move_uploaded_file(/home/folder/public_html/image/advert.jpg): failed to open stream: Permission denied in /home/folder/public_html/admin/edit.php on line 68 Warning: move_uploaded_file(): Unable to move '/tmp/phpNzNVd5' to '/home/folder/public_html/image/advert.jpg' in /home/pronta/public_html/admin/edit.php on...
4
3108
by: mrityunjay11 | last post by:
my ccode goes as such this is php_dbi.php <? function dbi_connect ( $host, $login, $password, $database ) { if ( strcmp ( $GLOBALS, "mysql" ) == 0 ) { $c = mysql_pconnect ( "192.168.100.3", $login, $password ); if ( $c ) { if ( ! mysql_select_db ( $database ) )
3
3878
by: sickboy | last post by:
$channels=$_GET; if (empty($channels)) { $channels='blank'; } changechannels($channels); $theatre=$_GET; if (empty($theatre)) { $theatre='splash'; } changetheatre($theatre); $info=$_GET; if (empty($info)) { $info='noinfo'; } changeinfo($info); Hey everyone, I keep getting an error regarding the above code. These are the errors: Notice: Undefined index: channels in /home/forcefed/public_html/index.php on line 5
3
1916
ganesanji
by: ganesanji | last post by:
hi all, I have written a php coding for uploading a file to a specific folder or location in server which is a Linux server. I think the coding for file uploaing is correct. But it does not work properly. That means the file is not uploaded to the specified location. It always executes the "else" condition in my coding. I think the problem is lieing in the specifed path which is the target path for file uploading. I could not find out...
10
2328
by: goodguyjam | last post by:
Hi again. I now get the above error with the exact same code as in my previous question. All I did was to rearrange the lines...no code changes...help! To assist you experts, line 11 contains this code - header(‘WWW-Authenticate: Basic realm=”secret section”’); Then when I remove the colon, I get a new error - syntax error, unexpected T_STRING in /home/allummfa/public_html/auth.php on line 11. This code is supposed to tell the web server to...
6
2623
by: goodguyjam | last post by:
Hi all, I'm having trouble with mysql. I've just finished my php coding for HTTP authentication and with some help am now getting a login window pop up whenever I click on a link on my website that directs to Auth.php. The code for this is below: <?php /* Program: Auth.php * Desc: Program that prompts for a user name and * password from the user using HTTP authentication.
0
9673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10443
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...
1
10165
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
10002
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...
1
7543
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6783
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5565
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
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
3
2921
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.