ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Installing Laravel on Ubuntu 20.04

    IT Discussion
    linux php php 7.4 ubuntu laravel ubuntu 20.04
    3
    28
    2.3k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • 1
      1337 @1337
      last edited by

      @Pete-S said in Installing Laravel on Ubuntu 20.04:

      @scottalanmiller

      Just a side note, but you are implying you already have apache up and running - since that is where you changed the php.ini files.

      Do laravel have any module requirements or needed config settings for apache as well?

      It's for example not unusual that you need to have mod_rewrite to beautify URLs or that you need to have htaccess files allowed etc.

      Perhaps you should assume a newly installed, clean ubuntu 20.04 as your base system.

      scottalanmillerS 1 Reply Last reply Reply Quote 0
      • scottalanmillerS
        scottalanmiller @1337
        last edited by

        @Pete-S said in Installing Laravel on Ubuntu 20.04:

        @scottalanmiller

        Just a side note, but you are implying you already have apache up and running - since that is where you changed the php.ini files.

        Do laravel have any module requirements or needed config settings for apache as well?

        It's for example not unusual that you need to have mod_rewrite to beautify URLs or that you need to have htaccess files allowed etc.

        No Apache, that's a PHP config file. You don't really use Apache in development, you can even test applications using Artisan with PHP in user space. I don't use Apache for production deployments either, we use Nginx.

        1 1 Reply Last reply Reply Quote 0
        • scottalanmillerS
          scottalanmiller @1337
          last edited by

          @Pete-S said in Installing Laravel on Ubuntu 20.04:

          @Pete-S said in Installing Laravel on Ubuntu 20.04:

          @scottalanmiller

          Just a side note, but you are implying you already have apache up and running - since that is where you changed the php.ini files.

          Do laravel have any module requirements or needed config settings for apache as well?

          It's for example not unusual that you need to have mod_rewrite to beautify URLs or that you need to have htaccess files allowed etc.

          Perhaps you should assume a newly installed, clean ubuntu 20.04 as your base system.

          It is, the PHP package creates that directory.

          1 Reply Last reply Reply Quote 0
          • black3dynamiteB
            black3dynamite
            last edited by

            Can’t php modules be enabled using phpenmod?

            1 Reply Last reply Reply Quote 1
            • 1
              1337 @scottalanmiller
              last edited by 1337

              @scottalanmiller said in Installing Laravel on Ubuntu 20.04:

              @Pete-S said in Installing Laravel on Ubuntu 20.04:

              @scottalanmiller

              Just a side note, but you are implying you already have apache up and running - since that is where you changed the php.ini files.

              Do laravel have any module requirements or needed config settings for apache as well?

              It's for example not unusual that you need to have mod_rewrite to beautify URLs or that you need to have htaccess files allowed etc.

              No Apache, that's a PHP config file. You don't really use Apache in development, you can even test applications using Artisan with PHP in user space. I don't use Apache for production deployments either, we use Nginx.

              OK, if you are not running apache or nginx, you should install the php-cli package instead.

              The php package has dependencies on a webserver, apache by default, so it will install those packages as well. It will install php-cli too but in addition to that a lot of stuff you don't need.
              Follow this to see what php actually installs: https://packages.ubuntu.com/focal/php7.4

              If you are running php from scripts, as has to be the case when you have no webserver, it's also very likely that it's not the apache2 php.ini file you want to change. It's most likely this one: /etc/php/7.4/cli/php.ini

              If you do php -i | grep .ini you can see which config file the installed php is actually using.

              It can be somewhat confusing since there are several php.ini and the cli and the apache/nginx module uses different ones by default. So it's easy to go change the first php.ini file you find and it turns out it's actually the one not being used. BTDT.

              scottalanmillerS 2 Replies Last reply Reply Quote 0
              • scottalanmillerS
                scottalanmiller @1337
                last edited by

                @Pete-S said in Installing Laravel on Ubuntu 20.04:

                OK, if you are not running apache or nginx, you should install the php-cli package instead.

                So that seems to get installed anyway as a dependency on its own.

                1 1 Reply Last reply Reply Quote 0
                • scottalanmillerS
                  scottalanmiller @1337
                  last edited by

                  @Pete-S said in Installing Laravel on Ubuntu 20.04:

                  If you do php -i | grep .ini you can see which config file the installed php is actually using.

                  You are correct, I checked and it's using CLI, not Apache. This is why I was writing the article, every freaking resource I can find on a Laravel install makes wild, awful assumptions like running as room, or installing Apache, even when they don't say it.

                  1 Reply Last reply Reply Quote 0
                  • 1
                    1337 @scottalanmiller
                    last edited by 1337

                    @scottalanmiller said in Installing Laravel on Ubuntu 20.04:

                    @Pete-S said in Installing Laravel on Ubuntu 20.04:

                    OK, if you are not running apache or nginx, you should install the php-cli package instead.

                    So that seems to get installed anyway as a dependency on its own.

                    Yes, it does. But by using the php package and not php-cli, you probably got apache installed on your system as well - by dependencies.

                    You could find out if it's installed by running: apt list --installed | grep apache

                    1 scottalanmillerS 2 Replies Last reply Reply Quote 0
                    • 1
                      1337 @1337
                      last edited by

                      @Pete-S said in Installing Laravel on Ubuntu 20.04:

                      @scottalanmiller said in Installing Laravel on Ubuntu 20.04:

                      @Pete-S said in Installing Laravel on Ubuntu 20.04:

                      OK, if you are not running apache or nginx, you should install the php-cli package instead.

                      So that seems to get installed anyway as a dependency on its own.

                      Yes, it does. But by using the php package and not php-cli, you probably got apache installed on your system as well - by dependencies.

                      You could find out by running: apt list --installed | grep apache

                      Or systemctl status apache2 to see if it's running.

                      scottalanmillerS 1 Reply Last reply Reply Quote 0
                      • scottalanmillerS
                        scottalanmiller @1337
                        last edited by

                        @Pete-S said in Installing Laravel on Ubuntu 20.04:

                        @scottalanmiller said in Installing Laravel on Ubuntu 20.04:

                        @Pete-S said in Installing Laravel on Ubuntu 20.04:

                        OK, if you are not running apache or nginx, you should install the php-cli package instead.

                        So that seems to get installed anyway as a dependency on its own.

                        Yes, it does. But by using the php package and not php-cli, you probably got apache installed on your system as well - by dependencies.

                        You could find out if it's installed by running: apt list --installed | grep apache

                        I meant php-cli gets installed.

                        I know that Apache is there but never used.

                        1 Reply Last reply Reply Quote 0
                        • scottalanmillerS
                          scottalanmiller @1337
                          last edited by

                          @Pete-S said in Installing Laravel on Ubuntu 20.04:

                          @Pete-S said in Installing Laravel on Ubuntu 20.04:

                          @scottalanmiller said in Installing Laravel on Ubuntu 20.04:

                          @Pete-S said in Installing Laravel on Ubuntu 20.04:

                          OK, if you are not running apache or nginx, you should install the php-cli package instead.

                          So that seems to get installed anyway as a dependency on its own.

                          Yes, it does. But by using the php package and not php-cli, you probably got apache installed on your system as well - by dependencies.

                          You could find out by running: apt list --installed | grep apache

                          Or systemctl status apache2 to see if it's running.

                          Even if it was, Laravel uses Artisan's server.

                          1 1 Reply Last reply Reply Quote 0
                          • 1
                            1337 @scottalanmiller
                            last edited by

                            @scottalanmiller said in Installing Laravel on Ubuntu 20.04:

                            @Pete-S said in Installing Laravel on Ubuntu 20.04:

                            @Pete-S said in Installing Laravel on Ubuntu 20.04:

                            @scottalanmiller said in Installing Laravel on Ubuntu 20.04:

                            @Pete-S said in Installing Laravel on Ubuntu 20.04:

                            OK, if you are not running apache or nginx, you should install the php-cli package instead.

                            So that seems to get installed anyway as a dependency on its own.

                            Yes, it does. But by using the php package and not php-cli, you probably got apache installed on your system as well - by dependencies.

                            You could find out by running: apt list --installed | grep apache

                            Or systemctl status apache2 to see if it's running.

                            Even if it was, Laravel uses Artisan's server.

                            I'm guessing they are invoking php's built-in webserver.

                            Regardless, the point is that if you swap php to php-cli in your install guide you don't get apache and other stuff you don't need.

                            1 Reply Last reply Reply Quote 1
                            • 1
                            • 2
                            • 2 / 2
                            • First post
                              Last post