PHP zip archive creation script

gamerdude

New Member
Messages
101
Reaction score
0
Points
0
I am working on a script to take a user specified file from a form, make a temporary copy on the server, make a zip archive, insert the file into the archive, send the file in the e-mail along with a message from the form, and then delete the zip archive from the server.

I have the e-mail part and the temporary file done, I just cannot get the script to make a zip archive and then insert a file into it, I am also unsure how I should delete it.
 
Last edited:

leafypiggy

Manager of Pens and Office Supplies
Staff member
Messages
3,819
Reaction score
163
Points
63
I dont believe you can insert into a zip file...there might be a .zip extension that allows it, like Gzip, but idk.
 

LHVWB

New Member
Messages
1,308
Reaction score
0
Points
0
What errors are you recieving? Could you please post them?
 

gamerdude

New Member
Messages
101
Reaction score
0
Points
0
Fatal error: Class 'ZipArchive' not found in
/home/dwayne/public_html/test-createzip.php on line 2
 

leafypiggy

Manager of Pens and Office Supplies
Staff member
Messages
3,819
Reaction score
163
Points
63
Corey might not have class "ZipArchive" enabled on the servers php.ini ...
 

phpasks

New Member
Messages
145
Reaction score
0
Points
0
php.ini enable ==> extension=php_zip.dll


After that your work
PHP:
echo phpinfo();


Configur Command:

'./configure' '--enable-bcmath' '--enable-calendar' '--enable-dbase' '--enable-exif' '--enable-ftp' '--enable-gd-native-ttf' '--enable-libxml' '--enable-magic-quotes' '--enable-mbstring' '--enable-pdo=shared' '--enable-soap' '--enable-sockets' '--enable-wddx' '--enable-zip' '--prefix=/usr' '--with-bz2' '--with-curl=/opt/curlssl/' '--with-curlwrappers' '--with-freetype-dir=/usr' '--with-gd' '--with-gettext' '--with-imap=/opt/php_with_imap_client/' '--with-imap-ssl=/usr' '--with-jpeg-dir=/usr' '--with-kerberos' '--with-libexpat-dir=/usr' '--with-libxml-dir=/opt/xml2' '--with-libxml-dir=/opt/xml2/' '--with-mcrypt=/opt/libmcrypt/' '--with-mhash=/opt/mhash/' '--with-mime-magic' '--with-mysql=/usr' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-mysqli=/usr/bin/mysql_config' '--with-openssl=/usr' '--with-openssl-dir=/usr' '--with-pdo-mysql=shared' '--with-pdo-sqlite=shared' '--with-pgsql=/usr' '--with-png-dir=/usr' '--with-pspell' '--with-sqlite=shared' '--with-ttf' '--with-xmlrpc' '--with-xpm-dir=/usr' '--with-xsl=/opt/xslt/' '--with-zlib' '--with-zlib-dir=/usr'


Asif Khalyani
http://www.phpasks.com
 

LHVWB

New Member
Messages
1,308
Reaction score
0
Points
0
I have made a post in the admin section so that an admin will see this issue and respond to it.

There may be some security flaws with this extension, or it may be that nobody else has ever wanted to use them.
 

phpasks

New Member
Messages
145
Reaction score
0
Points
0
wtf?



what does that have to do with anything?

Nobody user that help for you

SUPHP solved this problem.

http://phpasks.com/suphp/index.html
http://phpasks.com/suphp/phpsuexec.pdf

HTML:
page:http://your.servername.com/phpinfo.php/ simply look for the following near the top of that page. (4th Box Down Server API) :- “Server API Apache” This means that your server is currently running PHP as an apache module. 
If within the phpinfo page you see the following: “Server API CGI” Then your server has a CGI installation of PHP with suexec enabled.

Folder permission problem solved - 777 instead of 755
nobody user --> Your user name user eg. xyz user
 

scriptando

New Member
Messages
30
Reaction score
0
Points
0
hola

yo tengo un archivo para comprirmir archivos en zip, yo se los pasaria en estos dias y tambien una, que hice en c++ para convertir archivos a formato.pdf
 

gamerdude

New Member
Messages
101
Reaction score
0
Points
0
English translation of above:
hello
I have I file to [???] archives in zip, I [??] in these days and also one, that I made in c++ to turn archives to .pdf format

The folder permissions are all 7-7-7. I tried that after it failed the first error.
 
Last edited:

aneesher

New Member
Messages
3
Reaction score
0
Points
0
php.ini enable ==> extension=php_zip.dll


After that your work
PHP:
echo phpinfo();
Configur Command:

'./configure' '--enable-bcmath' '--enable-calendar' '--enable-dbase' '--enable-exif' '--enable-ftp' '--enable-gd-native-ttf' '--enable-libxml' '--enable-magic-quotes' '--enable-mbstring' '--enable-pdo=shared' '--enable-soap' '--enable-sockets' '--enable-wddx' '--enable-zip' '--prefix=/usr' '--with-bz2' '--with-curl=/opt/curlssl/' '--with-curlwrappers' '--with-freetype-dir=/usr' '--with-gd' '--with-gettext' '--with-imap=/opt/php_with_imap_client/' '--with-imap-ssl=/usr' '--with-jpeg-dir=/usr' '--with-kerberos' '--with-libexpat-dir=/usr' '--with-libxml-dir=/opt/xml2' '--with-libxml-dir=/opt/xml2/' '--with-mcrypt=/opt/libmcrypt/' '--with-mhash=/opt/mhash/' '--with-mime-magic' '--with-mysql=/usr' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-mysqli=/usr/bin/mysql_config' '--with-openssl=/usr' '--with-openssl-dir=/usr' '--with-pdo-mysql=shared' '--with-pdo-sqlite=shared' '--with-pgsql=/usr' '--with-png-dir=/usr' '--with-pspell' '--with-sqlite=shared' '--with-ttf' '--with-xmlrpc' '--with-xpm-dir=/usr' '--with-xsl=/opt/xslt/' '--with-zlib' '--with-zlib-dir=/usr'


Asif Khalyani
http://www.phpasks.com
Where can I find the php.ini file? Could you explain this better because I am getting the same problem with the SQLiteDataBase class
Thanks!
 
Top