How to update the php version in xampp?

Asked

Viewed 14,035 times

2

I am studying php and downloaded directly from the php site (php.net), the windows version and I am running on the localhost by command prompt. However, I wanted to use xampp as a local server, but when I use the command php -v at the command prompt with xampp installed, it points to an old version (5.6), and I wonder if there is any way to upgrade to the version of php in xampp that I downloaded directly from the official website.

  • 2

    This answer on Soen may help you: http://stackoverflow.com/a/4792439/2570426

  • It did, thank you!

  • I believe it is not possible without uninstalling the previous version. however you can backup the database and projects, uninstall and install the new version. at the end import the database and paste the projects. follows a tutor’s link: https://medium.com/@Asif.Rocks/how-to-upgrade-xampp-in-windows-the-easy-way-93031fc923ce NOTE: Do not forget to copy htdocs.

  • Follow full tutorial on this link

1 answer

1

I use Wamp but Xamp has the same behavior and I have a vhost for each system I use in my C: DEV directory. In case I do not move and it is interesting you leave your XAMP with the default setting and if you want to change you change in vhost that create.

So you must:

1) Download the version you want from PHP and paste into your XAMP folder that contains PHP:

(no problem having the other versions, in vhost you switch to the PHP version you want to use)

inserir a descrição da imagem aqui

2) Change according to your old file what you need in php.ini (extensions, directory, etc)

3) Create vhost for your website and enter the php configuration you want. Example:

(the configuration below assumes that you have the files of your site in the directory 'C:/DEV/seusistema', adapt your folder)

<VirtualHost *:80>

    DocumentRoot "C:/DEV/seusistema/public"
    ServerName seusistema

    <Directory "C:/DEV/seusistema/public">
        Options -Indexes +FollowSymLinks +ExecCGI
        AllowOverride All
        Require all granted
    </Directory>

    <Files ~ "\.php$>"
      AddHandler fcgid-script .php
      FcgidWrapper "c:/WAMP/PHP-7.2.12-NTS-WIN64-VC15/php-cgi.exe" .php
    </Files>


</VirtualHost>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.