Results 1 to 9 of 9

Thread: php 7.4 fails on Ubuntu 20.04

  1. #1
    Join Date
    Mar 2015
    Beans
    3

    php 7.4 fails on Ubuntu 20.04

    I have Ubuntu 20.04 running on 2 devices. (amd64 and armhf) I have installed a lamp server on both devices. The php 7.4 supplied with the distribution does not seen to work. The output of the php files produces the 'code' instead of the 'forms'. The same installation on Debian 9 (php version 7.0) works perfectly. Can someone help with solving this issue?
    R.

  2. #2
    Join Date
    May 2008
    Beans
    225
    Distro
    Lubuntu

    Re: php 7.4 fails on Ubuntu 20.04

    What happens when you enter 127.0.0.1 on your browser? Is apache running?
    Also, check if you have "libapache2-mod-php7.4" installed

  3. #3
    Join Date
    Mar 2015
    Beans
    3

    Re: php 7.4 fails on Ubuntu 20.04

    Yes. Apache2 is running . My web site is up. libapache2-mod-php installed. Instead of the php forms I get the code of the particular files displayed.

  4. #4
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    15,240
    Distro
    Kubuntu 20.04 Focal Fossa

    Re: php 7.4 fails on Ubuntu 20.04

    Try
    Code:
    sudo a2enmod php7.4
    On my machine with PHP working I get
    Code:
    Considering dependency mpm_prefork for php7.4:
    Considering conflict mpm_event for mpm_prefork:
    Considering conflict mpm_worker for mpm_prefork:
    Module mpm_prefork already enabled
    Considering conflict php5 for php7.4:
    Module php7.4 already enabled
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  5. #5
    Join Date
    Mar 2015
    Beans
    3

    Re: php 7.4 fails on Ubuntu 20.04

    SeijiSensei: Checked all. No change , info.php shows a blank page, other php files show the code.

  6. #6
    Join Date
    Mar 2011
    Location
    U.K.
    Beans
    Hidden!
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: php 7.4 fails on Ubuntu 20.04

    Some ideas ..
    (a) Tried clearing browser cache?
    (b) Cleared out any hidden .htaccess files?
    (c) Tried running
    Code:
    php -m

  7. #7
    Join Date
    May 2008
    Beans
    225
    Distro
    Lubuntu

    Re: php 7.4 fails on Ubuntu 20.04

    If none of the above works, check your log files and post?

  8. #8
    Join Date
    Aug 2017
    Beans
    126

    Re: php 7.4 fails on Ubuntu 20.04

    The output of the php files produces the 'code' instead of the 'forms'
    This is going to most likely be a configuration issue, not a PHP or OS issue.

    If you can run php -version and get a response, PHP is fine.

    Google around for "php doesn't execute," it is most likely an Apache config - php module commented out, no handlers for PHP in the domain, there are a couple reasons and they will all be very simple once you find them.

  9. #9
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    15,240
    Distro
    Kubuntu 20.04 Focal Fossa

    Re: php 7.4 fails on Ubuntu 20.04

    You aren't using "short tags" are you? See /etc/php/7.4/apache2/php.ini:

    Code:
    ; This directive determines whether or not PHP will recognize code between
    ; <? and ?> tags as PHP source which should be processed as such. It is
    ; generally recommended that <?php and ?> should be used and that this feature
    ; should be disabled, as enabling it may result in issues when generating XML
    ; documents, however this remains supported for backward compatibility reasons.
    ; Note that this directive does not control the <?= shorthand tag, which can be
    ; used regardless of this directive.
    ; Default Value: On
    ; Development Value: Off
    ; Production Value: Off
    ; http://php.net/short-open-tag
    short_open_tag = Off
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

Bookmarks

Posting Permissions

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