1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Solved Help starting Server

Discussion in 'Help' started by WinterBuild7074, Sep 14, 2017.

  1. WinterBuild7074

    WinterBuild7074 Zombie Pigman

    Messages:
    693
    GitHub:
    winterbuild7074
    Every time I try to start my server, it gives me the error:
    Code:
    ./bin/php7/bin/php: error while loading shared libraries: /home/mcpe/bin/php7/bin/php/../lib/libz.so.1: file too short
    php bin: https://jenkins.pmmp.io/job/PHP-7.2-Linux-x86_64/
    PocketMine-MP .phar: https://jenkins.pmmp.io/job/PocketMine-MP/

    Maybe I got the wrong php bin?

    My server's php version (php -v):
    Code:
    PHP 7.0.23-1-dotdeb+8.1 (cli) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-20117 Zend Technologies with Zend OPcache v7.0.23-rdotdeb48.12 Copyright (c) 1999-2017, by Zend Tec hnologies
    
    I'm using Debian 8.0.

    How my start.sh file looks like:
    Code:
    #!/bin/bash
    DIR="$(cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd)"
    cd "$DIR"
    
    DO_LOOP="yes"
    
    while getopts "p:f:l" OPTION 2> /dev/null; do
        case ${OPTION} in
            p)
                PHP_BINARY="$OPTARG"
                ;;
            f)
                POCKETMINE_FILE="$OPTARG"
                ;;
            l)
                DO_LOOP="yes"
                ;;
            \?)
                break
                ;;
        esac
    done
    
    if [ "$PHP_BINARY" == "" ]; then
        if [ -f ./bin/php7/bin/php ]; then
            export PHPRC=""
            PHP_BINARY="./bin/php7/bin/php"
        elif [[ ! -z $(type php) ]]; then
            PHP_BINARY=$(type -p php)
        else
            echo "Couldn't find a working PHP 7 binary, please use the installer."
            exit 1
        fi
    fi
    
    if [ "$POCKETMINE_FILE" == "" ]; then
        if [ -f ./PocketMine-MP.phar ]; then
            POCKETMINE_FILE="./PocketMine-MP.phar"
        elif [ -f ./src/pocketmine/PocketMine.php ]; then
            POCKETMINE_FILE="./src/pocketmine/PocketMine.php"
        else
            echo "Couldn't find a valid PocketMine-MP installation"
            exit 1
        fi
    fi
    
    LOOPS=0
    
    set +e
    while [ "$LOOPS" -eq 0 ] || [ "$DO_LOOP" == "yes" ]; do
        if [ "$DO_LOOP" == "yes" ]; then
            "$PHP_BINARY" "$POCKETMINE_FILE" $@
        else
            exec "$PHP_BINARY" "$POCKETMINE_FILE" $@
        fi
        if [ "$DO_LOOP" == "yes" ]; then
            if [ ${LOOPS} -gt 0 ]; then
                echo "Restarted $LOOPS times"
            fi
            echo "To escape the loop, press CTRL+C now. Otherwise, wait 5 seconds for the server to restart."
            echo ""
            sleep 5
            ((LOOPS++))
        fi
    done
    
     
    Last edited: Sep 14, 2017
  2. WinterBuild7074

    WinterBuild7074 Zombie Pigman

    Messages:
    693
    GitHub:
    winterbuild7074
  3. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer

    Messages:
    1,342
    GitHub:
    robske110
    looks like an issue with the Jenkins build...
    You can try to build it yourself:
    First install dependencies by running
    Code:
    apt-get install make autoconf automake libtool m4 wget getconf gzip bzip2 bison g++
    and then run
    Code:
    wget https://raw.githubusercontent.com/pmmp/php-build-scripts/master/compile.sh
    ./compile.sh -t linux64 -l -j4 -c -f x86_64
    
    -j<num> should be your core/thread count.

    Then, you should have a new bin located in the folder where you executed these commands.
     
    WinterBuild7074 likes this.
  4. WinterBuild7074

    WinterBuild7074 Zombie Pigman

    Messages:
    693
    GitHub:
    winterbuild7074
    When I try to start the server it says I need to use php 7.2 or higher. Is this now for php 7.0 or 7.2?
     
    Last edited: Sep 15, 2017
  5. sharletsings123

    sharletsings123 Baby Zombie

    Messages:
    116
    GitHub:
    sharletk
    Yes, we have moved over to PHP7.2 so you will need to get PHP 7.2 now.
     
  6. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer

    Messages:
    1,342
    GitHub:
    robske110
    that's weird these commands should have installed 7.2. Can you post the output these commands did give you?
     
  7. WinterBuild7074

    WinterBuild7074 Zombie Pigman

    Messages:
    693
    GitHub:
    winterbuild7074
    I knew what the problem was: I stopped the installer in the middle while the files were still uploading (it took a long while to finish, and I thought it froze, and closed it).
     
  8. Awzaw

    Awzaw Zombie Pigman Poggit Admin

    Messages:
    726
    GitHub:
    awzaw
    Although this isn't the problem here, there's no guarantee php - v is displaying the PHP version of your server...
     
  9. sharletsings123

    sharletsings123 Baby Zombie

    Messages:
    116
    GitHub:
    sharletk
    Probably try to do a complete install of PHP again,

    You can purge PHP and its file by doing,
    Code:
    sudo apt-get remove --purge php*
    
    ReInstall PHP 7.2 use ondrej/php.

    Then try to run PMMPs PHP Bin installation again.

    I don't know if the above `apt-get remove --purge` works for you as I have not used Debian or have any clue how it works but it will for Ubuntu 16.04!
     
  10. WinterBuild7074

    WinterBuild7074 Zombie Pigman

    Messages:
    693
    GitHub:
    winterbuild7074
    Forgot the add the add Solved tag, everything's working now! Thanks @robske_110 (Tim) for your help!
     
  11. sharletsings123

    sharletsings123 Baby Zombie

    Messages:
    116
    GitHub:
    sharletk
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.