Find the answer to your Linux question:
Results 1 to 10 of 10
when i try apt-get install php5-cli then i get the following error Reading package lists... Done Building dependency tree Reading state information... Done php5-cli is already the newest version. The ...
  1. #1
    Just Joined!
    Join Date
    Aug 2009
    Posts
    15

    problem installing php5-cli on ubuntu 9

    when i try

    apt-get install php5-cli then i get the following error

    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    php5-cli is already the newest version.
    The following packages were automatically installed and are no longer required:
    linux-headers-2.6.31-14
    Use 'apt-get autoremove' to remove them.
    0 upgraded, 0 newly installed, 0 to remove and 31 not upgraded.
    2 not fully installed or removed.
    After this operation, 0B of additional disk space will be used.
    Setting up php5-cli (5.2.10.dfsg.1-2ubuntu6.3) ...
    dpkg (subprocess): unable to execute installed post-installation script: Exec format error
    dpkg: error processing php5-cli (--configure):
    subprocess installed post-installation script returned error exit status 2
    dpkg: dependency problems prevent configuration of php-pear:
    php-pear depends on php5-cli | php4-cli; however:
    Package php5-cli is not configured yet.
    Package php4-cli is not installed.
    dpkg: error processing php-pear (--configure):
    dependency problems - leaving unconfigured
    No apport report written because the error message indicates its a followup error from a previous failure.
    Errors were encountered while processing:
    php5-cli
    php-pear
    E: Sub-process /usr/bin/dpkg returned an error code (1)

    What should i do

  2. #2
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    Execute this
    Code:
    sudo apt-get clean all
    sudo dpkg --configure -a
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  3. #3
    Just Joined!
    Join Date
    Aug 2009
    Posts
    15
    I tried that and got following

    sputnik@ubuntu:~$ sudo dpkg --configure -a
    Setting up php5-cli (5.2.10.dfsg.1-2ubuntu6.3) ...
    dpkg (subprocess): unable to execute installed post-installation script: Exec format error
    dpkg: error processing php5-cli (--configure):
    subprocess installed post-installation script returned error exit status 2
    dpkg: dependency problems prevent configuration of php-pear:
    php-pear depends on php5-cli | php4-cli; however:
    Package php5-cli is not configured yet.
    Package php4-cli is not installed.
    dpkg: error processing php-pear (--configure):
    dependency problems - leaving unconfigured
    Errors were encountered while processing:
    php5-cli
    php-pear
    sputnik@ubuntu:~$

  4. #4
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    Try to re-install php5-cli with force option
    Code:
    sudo dpkg -f install php5-cli
    In case it doesn't work, delete files php5 file in /var/lib/dpkg/info folder and re-install php5-cli.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  5. #5
    Just Joined!
    Join Date
    Aug 2009
    Posts
    15
    Thanks for that i removed the php5-cli files and re-installed again and there is no errors now.

    But when i use

    php "some file"
    it says

    The program 'php' is currently not installed. You can install it by typing:
    apt-get install php5-cli
    php: command not found

    If i again try to install php5-cli then it says that it is already installed


    i tried by going\

    127.0.0.1/testpage.php and it is working but not from command line

  6. #6
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    It looks like PATH has not been set correctly.
    Find php5-cli using find command and set its path in PATH variable.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  7. #7
    Just Joined!
    Join Date
    Aug 2009
    Posts
    15
    I get the following result


    root@ubuntu:/usr/local/src# find php5-cli
    find: `php5-cli': No such file or directory
    root@ubuntu:/usr/local/src# locate php5-cli
    /usr/share/doc/php5-cli
    /usr/share/lintian/overrides/php5-cli
    /var/lib/dpkg/info/php5-cli.list
    /var/lib/dpkg/info/php5-cli.md5sums
    /var/lib/dpkg/info/php5-cli.postinst
    /var/lib/dpkg/info/php5-cli.postrm
    /var/lib/dpkg/info/php5-cli.prerm
    root@ubuntu:/usr/local/src#

  8. #8
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    Navigate to /usr/share/lintian/overrides folder and execute php "some file" command. Does it work?
    Code:
    cd  /usr/share/lintian/overrides
    php <file>
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  9. #9
    Just Joined!
    Join Date
    Aug 2009
    Posts
    15
    It still says the same that php is not installed

  10. #10
    Trusted Penguin elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    2,301
    Have a look in /usr/bin, as php should be there. In my case it is ultimately a symlink to /usr/bin/php5 so you could try "php5 yourscript"
    If we hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate! (Zapp Brannigan)


    My new blog. It's probably not as good as I think it is.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...