Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP hosting recommendations? 1

Status
Not open for further replies.

Dweezel

Technical User
Joined
Feb 12, 2004
Messages
428
Location
GB
I'm getting racked off with my hosting provider! The way that they've got php configured seriously limits what I can do with my scripts. The worst of it being no upload_tmp_dir setting in the php.ini, which seriously limits any file uploading I can do.

PHP settings aside though, the reason I chose this hosting company are that they are cheap and reliable. I have a small reseller account with them (5 sites). For each site I get 500MB of web space, 5 mysql databases and 10GB of bandwidth (That's 50GB altogether!) and for this I pay $90 US.

I think the price is impossible to match, but I'm hoping someone on here can prove me wrong. I'm looking for a similar deal as the above, but with php settings that are less annoying (especially those pertaining to file uploads).

Any suggestions would be much appreciated. Cheers.

 
check (very carefully) portland.co.uk, use the forums, ask the questions. They are cheap, bandwidth on demand , and mysql +PHP but I'm unsure just how far they've tied it down.

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Two that I've used for reselling are and
Both have had their ups and downs with support and VsHosting is on its third owner in about a year.

Both give you a chunk of space and bandwidth and allow you to split it up how ever you like.

Ken
 
Thanks for all your suggestions. I sent yet another email to my hosting company, begging for them to set a temporary directory. This is the reply I got:


"I'm sorry to say, but we are still unable to enable this as it would leave our servers open to abuse.

However you can code the site to upload into your home directory insted, this would enable you to acheave the ame result."

??
I'm wondering what exactly 'code the site to upload into your home directory' means. I made it clear in the email that ftp'ing wasn't an option, as I need to make purely web based interfaces. Do you think he is talking about ftp, or am I missing something?
 
You can use ini_set to control the path inside the script to a dir of your choice...see here and look at the upload_tmp_dir



Bastien

Cat, the other other white meat
 
Thanks Bastien, but I think in that page that you linked me to 'upload_tmp_dir' has PHP_INI_SYSTEM in the third coloumn of that table. At the bottom of the table it says that 'PHP_INI_SYSTEM' settings can only be changed in the php.ini or httpd.conf files.
Wouldn't I need root access to alter any of these?
 
Dweezel,

You asked the same kind if question in another thread and I said I'd try to find you a solution, here it is. I was a little worries that people would use this as a security work aroud but it should be ok.
The browser has to run under windows and have msxml installed (most windows have it), I alos thinkyou have to be on IE5 or better (dim memories here!
It consists of two code files, one which runs in the browser. It has a file search box and the call to msxml which invokes a php script to respons to the request. The file is actually opend using the flat file oledb provider do be carefull !.
The php script just takes the post data and puts in a file.
have a go and tell me how you get on.

<html>
<head>
<title>Lets's put some data</title>
<head>
<body>
<script language=JavaScript>

function getfiledata(pDirectory,pFile) {
var message="";
var rs=new ActiveXObject("adodb.recordset");
var sdbpath=pDirectory;
var constr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=";
constr = constr + sdbpath + ';Extended Properties="text;HDR=no"';
var table = pFile;
var qry = "select * from " + table;
rs.open(qry, constr);
while (!rs.eof) {
document.write(rs(0));
message = message + rs(0) + "\n";
rs.MoveNext();
}
rs.Close();
return message;
}

function postXML(message_in)
{
var msobj = new ActiveXObject("MSXML2.XMLHTTP.3.0");
msobj.open("POST", "msobj.setRequestHeader("Content-Type", "application/x-msobj.setRequestHeader("Content-Length", message_in.length);
msobj.send(message_in);
}

function showme ()
{
message="filename=testfile1.txt&message=" + getfiledata("c:/kr/pages","test.txt");
alert(message);
postXML(message);

return false;
}
</script>

<form name="f1" action="post" onsubmit=" return showme()">
<input type=file name=fileobj>
<input type=submit>
</form>
</body>
</html>


and

<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modifled: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
if (array_key_exists("message", $_POST))
$message = $_POST["message"];
else
$message="no message supplied";

if (array_key_exists("filename", $_POST))
$filename = $_POST["filename"];
else
$filename="aaaaaaaa.$$$";
$path="c:/kr/pages/";
$fullpath=$path . $filename;
$fp=fopen($fullpath,"w");
fwrite($fp,$message);
fclose($fp);
?>
 
try I moved to them in November and for £16.99 a month I get 40Gb traffic per month, 2 mySQL DB's (I want more but I'll just add more £16.99 packages!), and pretty good support for everything.

I'm running OSCommerce and Actinic Catalogue on this hosting account and it's fast and reliable.
 
Thanks a lot Ingressman, if I can get that script to work it should solve all my problems, but I'm having some trouble.
Which bits do I need to change, and what files (if any) do I need to create on the server?

So far I've put the html/javascript part of the script into a html file, and the php part into a file named creatfile.php.

I've changed the " to "
I'm sure I need to change the 'c:/kr/pages'. Should this be changed to the full path to my public_html directory ('/home/mysite/public_html/')?

Thanks again. Sorry about all the questions, but the script (particularly the javascript) is well above my level. I'm finding it a bit hard to see exactly what's going on.
Cheers.
 
Just got this response from another forum:

"I don't think the setting of the upload_tmp_dir is the problem because if this field is left empty then the server will use system default temporary directory for HTTP uploaded files. There are three other posibillities. They may have set a temp folder for uploads but then set the chmod of that directory so as to block access. Or, they may have set the php.ini setting for file_uploads = Off. Finally, they could have set upload_max_filesize = 0M or some other very small vaule so as to make uploads effectivly impossible.

In many server configurations, such as the one I use, it's possible for users to overwrite some of the default php.ini settings for their own account. This is doen by making a new file called php.ini which you upload into the root of your account."


Do you think this is correct? The phpinfo() for my host shows that max_filesize = 2M and file uploads = on. In this situation would the upload_tmp_dir not being set have no effect, and a system default temporary directory be used?
 
First one, yes change the c:/kr to the directory you want to create the file on the server and all should be well.
The private php.ini, I think that might have worked in old version, There is a parameter on the command line version of PHP, which I tried to get to work to have php4 and 5 on the same machine but I gave up in the end.
Your best bet is to try and and see if the behaviour is supported in later versions of 4 and more importanty 5
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top