adrianTNT Posted October 15, 2007 Share Posted October 15, 2007 Hello. My host updated PHP to 5.1.6 and now zip functions like zip_open do not work, it says undefined function or something similar, "zip enabled" doesn't show on phpinfo() eider. Is there an easyer way to use the zip functions? Maybe by downloading and including the libraries by include lines? Or only by recompiling the php? (this one sounds complicated). What can I do? Quote Link to comment https://forums.phpfreaks.com/topic/73258-how-to-enable-zip-support-in-php-516/ Share on other sites More sharing options...
adrianTNT Posted October 15, 2007 Author Share Posted October 15, 2007 anyone ? Quote Link to comment https://forums.phpfreaks.com/topic/73258-how-to-enable-zip-support-in-php-516/#findComment-369786 Share on other sites More sharing options...
MasterACE14 Posted October 15, 2007 Share Posted October 15, 2007 could you post your code where you are using the zip functions, and post the "exact" error you are getting. This will give us a better idea of what the settings may be like on your web server. Regards ACE Quote Link to comment https://forums.phpfreaks.com/topic/73258-how-to-enable-zip-support-in-php-516/#findComment-369794 Share on other sites More sharing options...
adrianTNT Posted October 15, 2007 Author Share Posted October 15, 2007 Hi Ace, this is the code in the script, the error is: Fatal error: Call to undefined function zip_open() in ... // upload and unpack the zip of additional files if(isset($_FILES["zip_box"]['name']) and $_FILES["zip_box"]['name']!=''){ $dir = 'flash_files/'.$listing_id.'/'; $zip = zip_open($_FILES["zip_box"]['tmp_name']); while($zip_entry = zip_read($zip)) { $entry = zip_entry_open($zip,$zip_entry); $filename = zip_entry_name($zip_entry); $target_dir = $dir.substr($filename,0,strrpos($filename,'/')); $filesize = zip_entry_filesize($zip_entry); if (is_dir($target_dir) || mkdir($target_dir)) { if ($filesize > 0) { $contents = zip_entry_read($zip_entry, $filesize); file_put_contents($dir.$filename,$contents); echo $dir.$filename.'<br />'; // if there are php, asp files then rename them by adding _safe in the name if(strpos(strtolower($dir.$filename),'.php') == (strlen($dir.$filename)-4)){ rename($dir.$filename,$dir.$filename.'_safe'); } if(strpos(strtolower($dir.$filename),'.asp') == (strlen($dir.$filename)-4)){ rename($dir.$filename,$dir.$filename.'_safe'); } if(strpos(strtolower($dir.$filename),'.cgi') == (strlen($dir.$filename)-4)){ rename($dir.$filename,$dir.$filename.'_safe'); } if(strpos(strtolower($dir.$filename),'.js') == (strlen($dir.$filename)-3)){ rename($dir.$filename,$dir.$filename.'_safe'); } if(strpos(strtolower($dir.$filename),'.jsp') == (strlen($dir.$filename)-4)){ rename($dir.$filename,$dir.$filename.'_safe'); } } } } } I have previous server phpinfo and new server phpinfo, the new server is the one with problems, on the new server phpinfo I do not see the part "Zip Support Enabled". Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/73258-how-to-enable-zip-support-in-php-516/#findComment-369803 Share on other sites More sharing options...
trq Posted October 15, 2007 Share Posted October 15, 2007 My host updated PHP to 5.1.6 and now zip functions like zip_open do not work You will have to ask your host to add support for the zip extension. Unless you have root access, you cannot do this yourself. Quote Link to comment https://forums.phpfreaks.com/topic/73258-how-to-enable-zip-support-in-php-516/#findComment-369830 Share on other sites More sharing options...
adrianTNT Posted October 15, 2007 Author Share Posted October 15, 2007 My host updated PHP to 5.1.6 and now zip functions like zip_open do not work You will have to ask your host to add support for the zip extension. Unless you have root access, you cannot do this yourself. I have root access and the host (GoDaddy) doesn't want to enable the zips since is a dedicated server and they say is my responsibility; I expected the server to have basic functions available, but whatever. So how can I fix this as root? Quote Link to comment https://forums.phpfreaks.com/topic/73258-how-to-enable-zip-support-in-php-516/#findComment-369978 Share on other sites More sharing options...
trq Posted October 15, 2007 Share Posted October 15, 2007 What distro aare you using? Quote Link to comment https://forums.phpfreaks.com/topic/73258-how-to-enable-zip-support-in-php-516/#findComment-369979 Share on other sites More sharing options...
adrianTNT Posted October 15, 2007 Author Share Posted October 15, 2007 What distro aare you using? Im not sure what it means, is this the operating system version? It is Fedora 6 I also have plesk 8.2.1 installed (in case there is an easy way by plesk). This info is from my cpanel: Version psa v8.2.1_build82070918.10 os_FedoraCore 6 OS Linux 2.6.22.9-61.fc6 Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/73258-how-to-enable-zip-support-in-php-516/#findComment-369982 Share on other sites More sharing options...
trq Posted October 15, 2007 Share Posted October 15, 2007 You have a dedicted server and don't know what OS it is? Scary. As root run... yum install php-pecl-zip If successfull restart apache. Quote Link to comment https://forums.phpfreaks.com/topic/73258-how-to-enable-zip-support-in-php-516/#findComment-369985 Share on other sites More sharing options...
adrianTNT Posted October 16, 2007 Author Share Posted October 16, 2007 You have a dedicted server and don't know what OS it is? Scary. I didn't knew what 'distro' means, sure i know what an OS is Anyway ... I first asked godaddy to enable the zip on server, then they asked for permission to access the server and day later they told me that I need to do it myself, when I tried I could not access the server by SSH anymore, it disconnected me *before asking for password. After 4-5 more emails they said 4 Ips including my own is banned from accessing the SSH and in order to unban my IP I should login by SSH and edit some system files. ) Or I could pay them $75/ half hour and they could edit the files to unban me. So in order to access server by SSH you must first login by SSH and edit some files. LOL LOL. Thanks for the fast replies, I will try the commands as soon as they let me on the server. Quote Link to comment https://forums.phpfreaks.com/topic/73258-how-to-enable-zip-support-in-php-516/#findComment-370268 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.