Jump to content

Am I out of options for a web host?


JustinStone

Recommended Posts

Hey guys/girls. I've been having problems with MediaTemple GS web hosting lately. I have a content site that allows members to upload files(up to 99MB in size). But I have been having problems lately. My script stops dead on the 2 minute mark and throws either a 500 internal server error or I get the dreaded open_basedir error. Either way the upload script stops at the 2 minute mark. I have edited the php.ini file for a max_execution_time of 300(5 minutes right?). MediaTemple says that is the longest their GS will allow. But still I'm throwing an error at 2 minutes. Also, I've let my members know that the max file size is 99MB which stinks because I would like a limit of 200MB. MediaTemple again says that the GS will only allow a max of 99MB.

 

My php.ini file looks like the following

 

upload_max_filesize = 99M
post_max_size = 100M
memory_limit = 99M
max_execution_time = 300
magic_quotes_gpc = Off
output_buffering = 4096
allow_url_include = On
allow_url_fopen = On
session.save_path = /home/xxxxxx/data/tmp
 
 Am I really screwed with MediaTemple by not allowing me the larger uploads? The 99MB uploads MIGHT be ok, but I can't get the script to run any longer than 2 minutes.
Is there anyone out there with MediaTemple web hosting and can you run an upload script longer than 2 minutes or upload more thatn 99MB's?
 
Link to comment
Share on other sites

max_execution_time is the time limit of your .php script. your php script isn't invoked until after the file has been uploaded to the server and php (the language engine, not your .php script) has done things like check the various size limits, check for errors, and move the file to the temp upload file location. take a look at max_input_time - http://us2.php.net/manual/en/info.configuration.php#ini.max-input-time

Link to comment
Share on other sites

max_input_time is set to -1 by default on MediaTemples Grid service. I don't think this is the problem. When the submit button is clicked, all of the POST data and file checking should be done pretty quickly I would think. I just find it strange that all errors happen exactly at  the minute mark. With the 500 error, I've check the error logs and I see the mod_security error. MediaTemple refuses to help me with it by saying that they can not help with my php script. I really don't think it is the script, I believe it is something else. I know this was pretty vague, but I'm still learning this stuff, so hopefully someone out there has had similar problems as me and has gotten them fixed.

Edited by JustinStone
Link to comment
Share on other sites

I'm not coming here looking for quick help, I've been trying to figure this out myself for a couple months actually(sad, yes).

 

When I get the open_basedir error, it comes from the last line posted here.

   $tname2 = time();
   $track_name=$tname2.'.'.$extension2;
   $new_track_name="tracks/".$track_name;   
   $copied2 = copy($_FILES['track']['tmp_name'], $new_track_name);

And when I get the internal 500 error, it is the mod_security error

Link to comment
Share on other sites

MediaTemple has their defualt setting for the open_basedir set by default.

 

They said(and it show an example on their site) of what to have for someones site if there is an error. I have done what it shows, but I still get the error.

 

open_basedir = "/home/xxxxxx/data/tmp:/home/xxxxxx/domains/mysite/html"    

 

I change it to that, and the site works fine, but the upload will either throw the open_basedir error or the 500 error. (Will throw the errors even if I leave the default settings for open_basedir)

 

I'm stumped. Been banging my head for months.

Edited by JustinStone
Link to comment
Share on other sites

You really have to pinpoint what your problems are. Based on the information provided, it seems you are conflating several different problems. For example, open_basedir errors have nothing to do with file size. You have to isolate the specific problems you have and the specific error messages you receive given a set input.

 

I did notice a couple of things in your code:

 

First off:

 

$copied2 = copy($_FILES['track']['tmp_name'], $new_track_name);
You should read about and utilize http://www.php.net/manual/en/function.move-uploaded-file.php rather than copy.

 

You also have this:

 

$track_name=$tname2.'.'.$extension2;
$new_track_name="tracks/".$track_name;  
You should never use a relative path for file oriented routines as you are here with 'tracks/...'; You should establish a variable with the full base path to the 'tracks' directory and have that assigned so that your move_uploaded file is working with the full path to the directory ie. '/path/to/tracks' . $track_name.

 

As for the Media Temple restrictions, there are untold numbers of hosting options out there. If you can't live with MediaTemple's restrictions you can easily find plenty of other alternatives out there. It's all a question of price. Virtual hosting is often preferable to shared hosting when you have outgrown the limitations of the shared hosting environment, but shared hosting environments do tend to offer extremely low pricing. Of course the old saying tends to be true that "you get what you pay for". Shared Hosting is often a bait and switch, advertising unlimited resources while at the same time providing limits in the configuration, and at the same time, over subscribing the service. There is also a long history of weeding out customers that end up being heavy users of the resources. They make their money on pure volume and you pretty much are on your own when it comes to support, even when the support issues are ultimately caused by their configuration. Typically you can get a form of support and answers for a lot of your questions if you take them to the forums. For example MT has these: https://forum.mediatemple.net

 

Rarely will you be the first person to encounter a limitation like the one you describe.

Link to comment
Share on other sites

To take it back to the basics, I'm just using a small upload script that is found everywhere online. Here is what is going on with my uploads.

 

 

I'm getting an error now with mod_security when uploading a 96MB file.

 

[Fri May 09 19:47:45 2014] [error] [client xxx.xx.xxx.xxx] ModSecurity: Input filter: Failed writing 1460 bytes to temporary file (rc 1431). [hostname "mySite.com"] [uri "/TestUpload.php"] [unique_id "xxxxxxxxxxxxxxxxxxxxxxx"]

 

<?php
 
$target_path = "rider_pics/";
 
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
$message = $_FILES['uploadedfile']['error'];
 
if(move_uploaded_file($_FILES['uploadedfile']['name'], $target_path)) {
    echo "<input value='http://mysite.com/rider_pics/".  basename( $_FILES['uploadedfile']['name']).
    "' style='width: 100%'>";
} else{
    echo 'There was an error uploading the file, please try again!' . $message;
}
?>

 

And when trying to upload a smaller 14MB file, I get the error of '0' from $message. Error '0' should mean that the file uploaded without any problems, but the file isn't on my server. 

Edited by JustinStone
Link to comment
Share on other sites

The first example from the manual for move_uploaded_file

 

$uploads_dir = '/uploads';
foreach ($_FILES["pictures"]["error"] as $key => $error) {
if ($error == UPLOAD_ERR_OK) {
$tmp_name = $_FILES["pictures"]["tmp_name"][$key];
$name = $_FILES["pictures"]["name"][$key];
move_uploaded_file($tmp_name, "$uploads_dir/$name");
}
}
Look at line # 4. You need to use the key tmp_name not name as the source (the file to be moved).
Link to comment
Share on other sites

Ok, so. This script works, partially.

I have 6 different file sizes that I'm trying, 14MB, 26MB, 39MB, 52MB, 74MB and 92MB.

The 14, 26, 39 and 52 seem to upload just fine. When I get to the 74MB, I get the ELSE statement from below (There was an error uploading the file, please try again!)

 

I checked my error log on my server and this is shown

ModSecurity: Input filter: Failed writing 1460 bytes to temporary file (rc 889). [hostname "mySite.com"] [uri "/myScript.php"] [unique_id "XXXXXXXXXXXXXXXX"]

 
<?php
target_path = "rider_pics/";
 
$target_path = $target_path . basename( $_FILES['track']['name']);
 
$message = $_FILES['track']['error'];
 
if(move_uploaded_file($_FILES['track']['tmp_name'], $target_path))
{
    echo echo "The file " . basename( $_FILES['track']['name']) . " has been uploaded";
}
else
{
    echo 'There was an error uploading the file, please try again!' . $message;
}
 
 
?>
Edited by JustinStone
Link to comment
Share on other sites


<?php

if( isset( $_FILES['track'] ) )
{
if( ! is_dir( __DIR__ . '/uploads' ) )
{
mkdir( __DIR__ . '/uploads', 0777, TRUE );
}

if ( ! @copy( $_FILES['track']['tmp_name'], __DIR__ . '/uploads/' . $_FILES['track']['name'] ) )
{
if ( ! @move_uploaded_file( $_FILES['track']['tmp_name'], __DIR__ . '/uploads/' . $_FILES['track']['name'] ) )
{
echo $_FILES['track']['error'] . '<br />';
}
}

echo 'Upload attempted <br />';
}
else
{
echo 'No Track';
}

 

Link to comment
Share on other sites

I don't see why I would have to set the folder's permissions to 777 when 755 works just fine on the smaller sized files.

 

ModSecurity: Input filter: Failed writing 1460 bytes to temporary file (rc 1173).

 

Same error anyways with a 74MB file.

 

I need to disable this garbage. lol.

 

Does anyone really know what this error means. Searching google for days and no one really seems to have a straight answer.

Edited by JustinStone
Link to comment
Share on other sites

I don't see why I would have to set the folder's permissions to 777 when 755 works just fine on the smaller sized files.

 

ModSecurity: Input filter: Failed writing 1460 bytes to temporary file (rc 1173).

 

Same error anyways with a 74MB file.

 

I need to disable this garbage. lol.

 

Does anyone really know what this error means. Searching google for days and no one really seems to have a straight answer.

 

I wasn't suggesting that you use the script for production purposes, only to test basic file uploading. So 777 or 755, makes no difference.

 

Quick search on Google for "modsecurity input filter" gave me this:

 

https://discussion.dreamhost.com/thread-138012.html

 

See last response, which indicates something useful about mod security:

 

 

It's likely the /tmp/ directory that modsec2 is using is set down around the 100MB mark. You'd need to alter the modsec2.conf file to point SecTmpDir and SecUploadDir somewhere else - such as the upload_tmp_dir location you used in your PHP settings above.

Link to comment
Share on other sites

I would love to modify the modSecurity settings, but with MediaTemple's grid service for 20 bucks a month, they will not allow me to do that. They won't even do it for me because they say they can't on their shared server.

 

I've spoke with inMotion hosting and they told me they have no file size limit on uploads and they also said that if I have issues with modSecurity they would make the changes for me.

 

I think I may be leaving MediaTemple. For 20 bucks a month, I am way too limited for that price imo

Link to comment
Share on other sites

I would love to modify the modSecurity settings, but with MediaTemple's grid service for 20 bucks a month, they will not allow me to do that. They won't even do it for me because they say they can't on their shared server.

 

I've spoke with inMotion hosting and they told me they have no file size limit on uploads and they also said that if I have issues with modSecurity they would make the changes for me.

 

I think I may be leaving MediaTemple. For 20 bucks a month, I am way too limited for that price imo

I've used inMotion before, and also complained to everyone about how I felt they were deceptive and trying to get me to upgrade my account for no reason. As soon as I told them I was leaving, then all the sudden there was no problem. I've been using MDD Hosting, www.mddhosting.com for about 4 years now. I have a semi-dedicated account, which costs about $22 a month. They've been very helpful when I needed server changes, and they have a better "smaller business" type of customer support that works well for me. I have a lot of reasons that I like them, but some highlights are the litespeed server, php 5.5.12, and if something goes bonkers with the server they are very up-front with what is going on. For instance, when they had a hardware issue they emailed everyone letting them know that they were working on it and maybe to expect certain things. If you go with inMotion, remember this story if they tell you your account is using a lot of resources and they are going to need you to pay more for a better account.

Link to comment
Share on other sites

 

Hey guys/girls. I've been having problems with MediaTemple GS web hosting lately. I have a content site that allows members to upload files(up to 99MB in size). But I have been having problems lately. My script stops dead on the 2 minute mark and throws either a 500 internal server error or I get the dreaded open_basedir error. Either way the upload script stops at the 2 minute mark. I have edited the php.ini file for a max_execution_time of 300(5 minutes right?). MediaTemple says that is the longest their GS will allow. But still I'm throwing an error at 2 minutes. Also, I've let my members know that the max file size is 99MB which stinks because I would like a limit of 200MB. MediaTemple again says that the GS will only allow a max of 99MB.

 

My php.ini file looks like the following

 

upload_max_filesize = 99M
post_max_size = 100M
memory_limit = 99M
max_execution_time = 300
magic_quotes_gpc = Off
output_buffering = 4096
allow_url_include = On
allow_url_fopen = On
session.save_path = /home/xxxxxx/data/tmp
 
 Am I really screwed with MediaTemple by not allowing me the larger uploads? The 99MB uploads MIGHT be ok, but I can't get the script to run any longer than 2 minutes.
Is there anyone out there with MediaTemple web hosting and can you run an upload script longer than 2 minutes or upload more thatn 99MB's?

 

 

Maybe try a different service?  I like Hostgator myself and haven't had any problems with them.  Not sure on the file upload limits, but 99MB does seem pretty high... you'd almost have to go to a virtual server for that stuff almost (on most hosts).  But Hostgator (or even Bluehost) has their options customizable from what I've seen, but then again, I'm not dealing with 99MB uploads.  Usually ones 20MB or less myself.  Your host may do this to curtail massive file uploading for file sharing-type sites (not to say that you're doing that, but I could see that as a concern for webhosts).,

Edited by sirhawkeye
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.