XAMPP PHP RAR PROBLEM !!! PLEASE HELP !!!

Problems with the Windows version of XAMPP, questions, comments, and anything related.

XAMPP PHP RAR PROBLEM !!! PLEASE HELP !!!

Postby bogdanroxanutza » 20. November 2009 00:09

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.
bogdanroxanutza
 
Posts: 10
Joined: 19. November 2009 23:06

Re: XAMPP PHP RAR PROBLEM !!! PLEASE HELP !!!

Postby Izzy » 20. November 2009 00:48

There is no php_rar.dll extension in XAMPP 1.7.2 so your function will always error.

I see that the Windows dll extension is not available from official sources as there is a new version in the pipeline which may mean that older extensions may not be compatible with PHP 5.3.

BTW XAMPP 1.7.1 version has this extension included and older XAMPP versions can be downloaded from the SourceForge Repository.
You may have to still add the extension details in the php.ini file as I don't see it on a vanilla 1.7.1 installation - then restart Apache as before.

Remember that in XAMPP versions before 1.7.1 the php.ini file is in the apache\bin folder not in the php folder.


Here are some links that may help with researching this:
http://us.php.net/manual/en/rar.installation.php
http://pecl4win.php.net/ext.php/php_rar.dll

Possible extension download site for PHP 5.2 versions:
http://kromann.info/download.php?strFol ... dex=PHP5_2

Google search results:
http://www.google.com/search?q=php_rar.dll+extension
http://www.google.com/search?q=%22Call+ ... n%28%29%22
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: XAMPP PHP RAR PROBLEM !!! PLEASE HELP !!!

Postby bogdanroxanutza » 20. November 2009 01:16

Hello!

Thanks a lot for your answer, i get that error on version 1.7.1 and lower, i forgot to mention the version, my bad.

I also tried to change the xampp 1.7.1 and lower php_rar.dll with the php_rar.dll from http://kromann.info/download.php?strFol ... dex=PHP5_2 but still the same problem.

I restarted the apache when i made changes in php.ini but the same problem.
bogdanroxanutza
 
Posts: 10
Joined: 19. November 2009 23:06

Re: XAMPP PHP RAR PROBLEM !!! PLEASE HELP !!!

Postby Izzy » 20. November 2009 01:23

See if there are any clues in the \xampp\apache\logs\error.log file.


You are not alone with your issue:
http://www.google.com/search?q=rar_open ... indows+PHP

Have you installed the rar and unrar binaries so the dll can connect?

You may also have to include the full path in your function rar_open("C/path/t/the/rar/file")
Last edited by Izzy on 20. November 2009 01:31, edited 3 times in total.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: XAMPP PHP RAR PROBLEM !!! PLEASE HELP !!!

Postby bogdanroxanutza » 20. November 2009 01:28

Thanks for your reply, i will check in a few minutes the error.log
bogdanroxanutza
 
Posts: 10
Joined: 19. November 2009 23:06

Re: XAMPP PHP RAR PROBLEM !!! PLEASE HELP !!!

Postby bogdanroxanutza » 20. November 2009 01:37

Logs with extension=php_rar.dll in php.ini with restart of apache:

[Fri Nov 20 02:39:17 2009] [notice] Parent: child process exited with status 3221225477 -- Restarting.
[Fri Nov 20 02:39:18 2009] [notice] Digest: generating secret for digest authentication ...
[Fri Nov 20 02:39:18 2009] [notice] Digest: done
[Fri Nov 20 02:39:21 2009] [notice] Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i PHP/5.2.9 configured -- resuming normal operations
[Fri Nov 20 02:39:21 2009] [notice] Server built: Dec 10 2008 00:10:06
[Fri Nov 20 02:39:21 2009] [notice] Parent: Created child process 2316
[Fri Nov 20 02:39:23 2009] [notice] Digest: generating secret for digest authentication ...
[Fri Nov 20 02:39:23 2009] [notice] Digest: done
[Fri Nov 20 02:39:25 2009] [notice] Child 2316: Child process is running
[Fri Nov 20 02:39:25 2009] [notice] Child 2316: Acquired the start mutex.
[Fri Nov 20 02:39:25 2009] [notice] Child 2316: Starting 250 worker threads.
[Fri Nov 20 02:39:25 2009] [notice] Child 2316: Starting thread to listen on port 443.
[Fri Nov 20 02:39:25 2009] [notice] Child 2316: Starting thread to listen on port 80.


With the full path -> the same problem :(
bogdanroxanutza
 
Posts: 10
Joined: 19. November 2009 23:06

Re: XAMPP PHP RAR PROBLEM !!! PLEASE HELP !!!

Postby Izzy » 20. November 2009 01:40

I am stabbing in the dark here myself but when you are in a hurry I can only make suggestions.

The log file looks like a normal start with no [error] entries.

This may be a Windows System issue and a peek into the Event Viewer may provide some clues

When you have activated the extension check in the http://localhost/xampp/phpinfo.php to see if it has been loaded correctly, there should be an entry in this file.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: XAMPP PHP RAR PROBLEM !!! PLEASE HELP !!!

Postby bogdanroxanutza » 20. November 2009 01:45

The rar is enabled.

I do:

<?php

phpinfo();

?>

And i see there:
-------------------------------------
Rar support enabled
Extension version 1.0.1-dev
Revision $Revision: 1.24 $
UnRAR version 3.71 beta1
-------------------------------------
bogdanroxanutza
 
Posts: 10
Joined: 19. November 2009 23:06

Re: XAMPP PHP RAR PROBLEM !!! PLEASE HELP !!!

Postby bogdanroxanutza » 20. November 2009 02:21

Could anybody install xampp 1.7.1 on his computer and add that extension in php.ini?

I really appreciate any answer and any effort. Thanks
bogdanroxanutza
 
Posts: 10
Joined: 19. November 2009 23:06

Re: XAMPP PHP RAR PROBLEM !!! PLEASE HELP !!!

Postby Izzy » 20. November 2009 02:29

Could anybody install xampp 1.7.1 on his computer and add that extension in php.ini?
I have 5 XAMPP versions installed to aid in forum troubleshooting.

The extension installs in 1.7.1 with no error when Apache is started and I can go to http://localhost and see the Welcome Page also http://localhost/xampp/phpinfo.php and see the enabled extension.

I tried and was successful in 4 out of 5 with XAMPP 1.7.2 being the obvious exception.



I know this is no consolation but, from past experience, when a ever a php extension is not included in the php.ini file it usually means it is buggy or is omitted for some other non functioning reason that does not sit well in XAMPP's PHP installation, even though it is included in the ext folder.

A good example of this is in the latest 1.7.2 version where even the dll is not included in the installation files.

Only as a last resort suggestion perhaps convert your rar files to zip format and use the included and already uncommented php_zip dll in the php.ini.

Sorry I could not be more help and I wish you good luck in your project.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 89 guests