2015-05-05 260 views
2

服務器安裝了debian wheezy os。 PHP版本是PHP5.3:安裝php 5.3.3-7 + squeeze17的imap擴展

[email protected]:~# php -v 
PHP 5.3.3-7+squeeze17 with Suhosin-Patch (cli) (built: Aug 23 2013 15:06:16) 

我試着通過安裝擴展IMAP apt-get和結果是:

[email protected]:~# 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 

當我嘗試另一個版本,我得到:

[email protected]:~# 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. 

有沒有人知道在這種情況下安裝php5-imap最安全的方法? P.S.更新到5.4,從喘息回購不解決:(

回答

0

我解決了問題與調用外部python腳本,它使用imaplib(http://pymotw.com/2/imaplib/)從PHP調用蟒蛇 例:

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