PHP7 Compiled Fine... How to 'activate' ?

Discussion in 'Install/Configuration' started by oranuf, Mar 6, 2018.

  1. oranuf

    oranuf Member

    My first forum post, and this is probably a stupid question, but I haven't been a PHP person very long...
    Clean install of LiteSpeed on CentOS 7, and a completed compile of PHP7 from the Litespeed admin menu (twice, actually).
    Graceful restart of LiteSpeed.
    But on my LiteSpeed example home page, when clicking PHP, version still shows as 5.6.
    How do I upgrade to the version i just successfully compiled?
    Thanks! :D
     
  2. oranuf

    oranuf Member

    bump
     
  3. Michael A

    Michael A Administrator Staff Member

  4. oranuf

    oranuf Member

    Hi Michael,

    I did get as far as setting the external application and script handler, and the test PHP page offered by the default litespeed virtual host did in fact show me PHP 7.2.1... i was thrilled! But the wordpress site i had running on the same server suddenly couldn't connect to the local MySQL database. As soon as I switched back to PHP 7.0, it started working again. Not sure what else i need to change/update to get it to go, but i'm so very close...
     
  5. Michael A

    Michael A Administrator Staff Member

    Hmm I'm not too sure on this one. I checked with some team members and saw that ext/mcrypt was dropped in v7.2 (http://php.net/manual/en/migration71.deprecated.php) so that could be causing the issue if MySQL needs this.

    I would also make sure that you are running an up-to-date version of MySQL to make sure that it isn't the issue. WP recommends v5.6 or greater (https://wordpress.org/about/requirements/)

    Other than that I will leave this question for someone on the team with a little more MySQL troubleshooting experience :)
     
  6. oranuf

    oranuf Member

    Does openlitespeed current version support caching logged-in users?
     
  7. oranuf

    oranuf Member

    and yet another thing has cropped up...
    Everything was working perfectly - wordpress site serving up cached pages when not logged, etc, litespeed admin site and example pages working fine....

    I experimented (carefully) with a few settings via the WordPress plugin... things seized up, and upon reboot, the wordpress site was still working (sorta - no cache hits), but the LS admin/example no longer loaded via domain name, but instead only by IP. after getting in by ip, going to server config > modules and toggling "enableCache" from 0 to 1 and back to 0, the caching on the WP started working at least.

    Would like the LS admin site to still load by domain name if possible. If there are any clues, let me know.
     
  8. Michael A

    Michael A Administrator Staff Member

    Hello oranuf,

    Very sorry for the lack of responses lately, are you still having issues?
     
  9. oranuf

    oranuf Member

    It's okay, i know you guys are busy.
    I managed to create a docker image starting with Litespeed and I believe PHP7.0, and then upgrade PHP from there... i wish I could be more helpful, but honestly I don't remember the details of what I did, I only know that for Debian/Litespeed/PHP7.2/MariaDB, i seem to have everything working on several Docker containers now. For larger sites I'll be splitting MariaDB into separate containers/proper microservices, but for a fast deployment of the latest WordPress with the latest LiteSpeed and PHP, I've got a base Docker image that rocks now. This web server tech is truly fantastic, allowing some of these sites to run on a machine with as little as one shared vCPU and .6GB of RAM!
     
    Michael A likes this.
  10. Michael A

    Michael A Administrator Staff Member

    Glad to hear that you figured it out!
    No problem on not remembering the steps, we're just happy that your up and running and enjoying the results!
     
  11. oranuf

    oranuf Member

    I *am* facing one more issue, but I'm not sure if it could be litespeed related. I have a wordpress site running on LS, that is using a plugin that requires PHP-imagemagick module. I'm pretty sure that all the instructions for getting this working in PHP are for Apache installs. Would you happen to have any advice on how to do the same with LS on Debian, or at least a pointer in the right direction?
     
  12. Michael A

    Michael A Administrator Staff Member

  13. oranuf

    oranuf Member

    Attempted via the "install PEAR package manager" section, got as far as this line:
    Code:
    /usr/local/lsws/lsphp55/bin/pecl install imagick
    which I modified to:
    Code:
    /usr/local/lsws/lsphp72/bin/pecl install imagick
    but all i get is:
    Code:
    /usr/local/lsws/lsphp72/bin/pecl: 28: exec: /usr/local/lsws/lsphp72/bin/php: not found
     
    Last edited by a moderator: Mar 23, 2018
  14. oranuf

    oranuf Member

    i tried to decypher the scripts in pecl and pear, found in my directory /usr/local/lsws/lsphp72/bin/ but it seems my directories and file locations are FUBAR compared to what these scripts are expecting. NO idea what to do next. Using YUM to check the LiteSpeed repo is not an option because this is Debian, and the instructions for compiling it manually... let's just say my eyes glazed over and I'm certain I'd not get THAT right. Stuck without this extension, and client is apparently needing it.
     
  15. Jon K

    Jon K Administrator Staff Member

    Your only option might be just to try manually. Though it isn't as hard as it looks like just run these commands one by one and make sure they all run properly. If they dont just either respond back here or send me a message and I can help you.

    Code:
    apt-get install libmagickwand-dev pkg-config build-essential
    mkdir -p ~/tmp
    pushd ~/tmp
    wget https://pecl.php.net/get/imagick-3.4.3.tgz
    tar -xf imagick-3.4.3.tgz
    cd imagick-3.4.3
    /usr/local/lsws/lsphp70/bin/phpize
    ./configure --with-php-config=/usr/local/lsws/lsphp70/bin/php-config
    make
    make install
    echo "extension=imagick.so" >> /usr/local/lsws/lsphp70/etc/php/7.0/mods-available/40-imagick.ini
    /usr/local/lsws/bin/lswsctrl restart
    popd
    
     
  16. oranuf

    oranuf Member

    stuck at:
    /usr/local/lsws/lsphp70/bin/phpize
    with message:
    bash: /usr/local/lsws/lsphp70/bin/phpize: No such file or directory
    i do not have /usr/local/lsws/lsphp70 - the nearest thing I have is
    /usr/local/lsws/lsphp72/bin
    with no phpize in it, neither directory nor file. In fact a locate phpize returns nothing.
    It seems that because i'm running php 7.2 , i've screwed up any chance of making the usual solutions I find on the web actually work =)
     
  17. Jon K

    Jon K Administrator Staff Member

    How do you have lsphp72 installed? via apt? If so can i get the output of:
    Code:
    dpkg -l | grep lsphp72
     
  18. oranuf

    oranuf Member

    i don't recall how i have it installed, but this is the output of that command:

    Code:
    ii  lsphp72                            7.2.2-2+stretch                amd64        server-side, HTML-embedded scripting language (LSAPI binary)
    ii  lsphp72-common                     7.2.2-2+stretch                all          Common files for packages built from the PHP source
    ii  lsphp72-curl                       7.2.2-2+stretch                amd64        CURL module for PHP
    ii  lsphp72-imap                       7.2.2-2+stretch                amd64        IMAP module for PHP
    ii  lsphp72-json                       7.2.2-2+stretch                amd64        JSON module for PHP
    ii  lsphp72-mysql                      7.2.2-2+stretch                amd64        MySQL module for PHP
    ii  lsphp72-opcache                    7.2.2-2+stretch                amd64        Zend OpCache module for PHP
     
    Last edited by a moderator: Mar 23, 2018
  19. Jon K

    Jon K Administrator Staff Member

    Try running the following:
    Code:
    apt-get install lsphp72-*
    Seems you are missing a couple lsphp72 packages and that should install them. Then you should have phpize and might have PEAR as well.
     
  20. oranuf

    oranuf Member

    I guess i'll need to add that command to my Dockerfiles after the one click install of ols, as that's where I believe the PHP72 install came from:
    FROM debian:9.3
    Code:
    # add utilities
    RUN apt-get update && apt-get install -y \
        apt-utils \
        procps \
        gnupg \
        mlocate \
        net-tools \
        nano
    
    # copy the LiteSpeed one-click script into the container and run it
    COPY [ "ols1clk.sh", "/tmp/" ]
    
    RUN /bin/bash /tmp/ols1clk.sh \
        --adminpassword '[REDACTED]' \
        --email 'admin@[REDACTED]' \
        --lsphp '72' \
        --mariadbver '10.2' \
        --dbrootpassword '[REDACTED]' \
        --dbname '[REDACTED]' \
        --dbuser '[REDACTED]' \
        --dbpassword '[REDACTED]' \
        --wordpress
    
    ...etc...
     
    Last edited by a moderator: Mar 23, 2018

Share This Page