XAMPP PHP RAR PROBLEM !!! PLEASE HELP !!!
Posted: 20. November 2009 00:01
Hello!
I want to extract .rar archives with php .
I use:
-----------------------------------------------------------------------
$rar_file = rar_open('example.rar') or die("Can't open Rar archive");
$entries = rar_list($rar_file);
foreach ($entries as $entry) {
echo 'Filename: ' . $entry->getName() . "\n";
echo 'Packed size: ' . $entry->getPackedSize() . "\n";
echo 'Unpacked size: ' . $entry->getUnpackedSize() . "\n";
$entry->extract('/dir/extract/to/');
}
rar_close($rar_file);
-----------------------------------------------------------------------
When i do that i get this error:
-----------------------------------------------------------------------
Fatal error: Call to undefined function rar_open() in C:\xampp\htdocs\index.php on line 5
-----------------------------------------------------------------------
Ok, i opend php.ini, and i added this line -> extension=php_rar.dll, under extensions, then i restart the apache .
Now, when i do http://localhost/ and hit enter i get:
-----------------------------------------------------------------------
The connection was reset...bla bla
-----------------------------------------------------------------------
Now, when i remove extension=php_rar.dll and restart apache and do http://localhost and hit enter i get again:
-----------------------------------------------------------------------
Fatal error: Call to undefined function rar_open() in C:\xampp\htdocs\index.php on line 5
But: apache doesen't crush
------------------------------------------------------------------------
I tried older versions of xampp but i still have that problem.
I use xampp with windows xp service pack 3 and i test with mozilla firefox.
I search the whole google and i did not find anything about how i can fix this problem.
I am stuck with my project and i tried to fix that but with no results and 6 days went.
So please, could anybody help me with this? I really need to solve this very fast, please !!!
Any examples or suggestion are very good.
Thanks a lot, i appreciate any answer or help and sory for my bad english.
I want to extract .rar archives with php .
I use:
-----------------------------------------------------------------------
$rar_file = rar_open('example.rar') or die("Can't open Rar archive");
$entries = rar_list($rar_file);
foreach ($entries as $entry) {
echo 'Filename: ' . $entry->getName() . "\n";
echo 'Packed size: ' . $entry->getPackedSize() . "\n";
echo 'Unpacked size: ' . $entry->getUnpackedSize() . "\n";
$entry->extract('/dir/extract/to/');
}
rar_close($rar_file);
-----------------------------------------------------------------------
When i do that i get this error:
-----------------------------------------------------------------------
Fatal error: Call to undefined function rar_open() in C:\xampp\htdocs\index.php on line 5
-----------------------------------------------------------------------
Ok, i opend php.ini, and i added this line -> extension=php_rar.dll, under extensions, then i restart the apache .
Now, when i do http://localhost/ and hit enter i get:
-----------------------------------------------------------------------
The connection was reset...bla bla
-----------------------------------------------------------------------
Now, when i remove extension=php_rar.dll and restart apache and do http://localhost and hit enter i get again:
-----------------------------------------------------------------------
Fatal error: Call to undefined function rar_open() in C:\xampp\htdocs\index.php on line 5
But: apache doesen't crush
------------------------------------------------------------------------
I tried older versions of xampp but i still have that problem.
I use xampp with windows xp service pack 3 and i test with mozilla firefox.
I search the whole google and i did not find anything about how i can fix this problem.
I am stuck with my project and i tried to fix that but with no results and 6 days went.
So please, could anybody help me with this? I really need to solve this very fast, please !!!
Any examples or suggestion are very good.
Thanks a lot, i appreciate any answer or help and sory for my bad english.