Closed Tropaion closed 10 years ago
Try to change your /tmp
folder permissions to 0755 or 0777.
Can you please provide information about server and software (apache, etc.) versons?
Here you can see some Infos http://www.yakuzasubs.at/phpinfo.php I dont know Apache Version, but I had PHP5.3 and now I changed to PHP5.5. I dont have access with my ftp Account to the tmp Folder, but I think the permissions are already 0777, because I can upload files in this directory. You can try this here: http://www.yakuzasubs.at/test.php The code of this site is:
<form action="test.php" method="post" enctype="multipart/form-data">
<input type="file" name="datei"><br>
<input type="submit" value="Hochladen">
</form>
$type = $_FILES['datei']['type'];
echo $type;
$size = $_FILES['datei']['size'];
echo $size;
$dir = $_FILES['datei']['tmp_name'];
echo $dir;
//Dateiendung herrausfinden
$typ = explode (".", $_FILES['datei']['name']);
$count = count($typ);
$count--;
echo "<br>$typ[$count]";
include ('GoogleTranslate.php');
$tr = new GoogleTranslate("en", "de");
echo $tr->translate("Hello World!");
Translation code works fine for me both on local and remote web servers. There is a problem with open_basedir
settings in your PHP configuration. Take a look at this answer on stackoverflow.
Ok thank you, I will write a mail to my hoster. But the funny thing ist that the translation works....with error but it works.
I've pushed two commits https://github.com/Stichoza/google-translate-php/commit/1fee0dc668697ca9398299c6e13ca95d119ec71e and try with this version of code. Changed /tmp
with sys_get_temp_dir()
to get directory path used for temporary files.
P.S. There's a huge difference between Errors and Warnings
Yeah, sure. Okay, thank you for that code. I tried it, but the same error occurs.
My hoster told me to control my program code. The path to webspace is /home/.sites/117/site3029/web
.
By the way sys_get_temp_dir()
output is /tmp
- thats funny :smiley:
Now I made a folder with ftp with the permissions 777 and used the path /home/.sites/117/site3029/web/tmp
. Now it works.
That's weird :smile: Okay, happy your code works. Good luck!
Yeah! Thanks for your help, and a great Code!
Hello, I have tried this:
And I got two Errors and the translated text:
Can you tell me what is my mistake?