Search code examples
phpdebianimapphp-extensionapt-get

Install imap extension for php 5.3.3-7+squeeze17


Server has debian wheezy os installed. Php version is php5.3:

 user@example:~# php -v
 PHP 5.3.3-7+squeeze17 with Suhosin-Patch (cli) (built: Aug 23 2013 15:06:16) 

I try to install imap extension via apt-get and the result is:

user@example:~# apt-get install php5-imap=5.3.3-7+squeeze17
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Version '5.3.3-7+squeeze17' for 'php5-imap' was not found

When I try another version I get:

user@example:~# apt-get install php5-imap=5.3.3-7+squeeze19
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 php5-imap : Depends: php5-common (= 5.3.3-7+squeeze19) but 5.3.3-7+squeeze17 is to be installed
E: Unable to correct problems, you have held broken packages.

Does anybody know the safest way to install php5-imap in this case? P.S. Update to 5.4 from wheezy repo is not solution :(


Solution

  • I solved the issue with calling external python script, which uses imaplib (http://pymotw.com/2/imaplib/). Example of calling python from php:

     <? exec("python <ABSOLUTE_PATH_TO_SCRIPT>.py " . escapeshellarg($arg1));