logo

  • Hỏi Đáp
  • Kiến Thức
  • Sức Khỏe
  • Tử Vi
  • Công Nghệ
No Result
View All Result
logo
No Result
View All Result
Trang chủ browse /xampp windows/5

Browse /Xampp Windows/5

by Admin _ May 23, 2022

But there are old projects which use functions lượt thích mysql_connect, etc. Those are removed in PHP 7.0.

Bạn đang xem: Browse /xampp windows/5

So, is there a way to lớn easily change PHP versions in XAMPP?

Note: Please don"t suggest to lớn upgrade old project to compatible with new versions because I am not in a position to do it because of that decisions I can"t get as a developer (just an employee).


*

Why switch between PHP versions when you can use multiple PHP versions at the same time with a single xampp installation?

With a single xampp installation, you have 2 options:

Run an older PHP version for only the directory of your old project: This will serve the purpose most of the time. You may have one or two old projects that you intend to run with an older PHP version. Just configure xampp to run an older PHP version for only those project directories.

Run an older PHP version on a separate port of xampp: Sometimes you may be upgrading an old project to the latest PHP version & at the same time you need khổng lồ run the same project back và forth between the new PHP version và the old PHP version. To do this you can mix an older PHP version on a different port (say 8056) so when you go lớn http://localhost/any_project/, xampp runs PHP 7 & when you go khổng lồ http://localhost:8056/any_project/ xampp runs PHP 5.6.

Run an older PHP version on a virtualhost: You can create a virtualhost like localhost56 khổng lồ run PHP 5.6 while you can use PHP 7 on localhost.

Lets phối it up

Step 1: download PHP

So you have PHP 7 running under xampp, you want to showroom an older PHP version to it (say PHP 5.6). Tải về the nts (Non Thread Safe) version of the PHP zip archive from php.net (see archive for older versions) and extract the files under c:xamppphp56. The thread safe version does not include php-cgi.exe.

Xem thêm: array push php

Step 2: Configure php.ini

Open the tệp tin c:xamppphp56php.ini in notepad. If the tệp tin does not exist, copy php.ini-development khổng lồ php.ini and mở cửa it in notepad. Then uncomment the following line:

extension_dir = "ext"Also if the following line exists in Apache config httpd-xampp.conf

SetEnv PHPRC "\path\to\xampp\php"comment it out with with a leading # (hash character).

Step 3: Configure apache

Open xampp control panel, click the config button for apache, & click Apache (httpd-xampp.conf). A text tệp tin will open. Put the following settings at the bottom of the file:

ScriptAlias /php56 "C:/xampp/php56"Action application/x-httpd-php56-cgi /php56/php-cgi.exe AllowOverride None Options None Require all denied Require all granted Note: You can add more versions of PHP to lớn your xampp installation following step 1 to 3 if you want.

Step 4 (option 1):

Now you can set directories that will run in PHP 5.6. Just showroom the following at the bottom of the config tệp tin (httpd-xampp.conf from Step 3) to set directories.

SetHandler application/x-httpd-php56-cgi SetHandler application/x-httpd-php56-cgi Step 4 (option 2):

Now khổng lồ to phối PHP v5.6 on port 8056, địa chỉ the following code to lớn the bottom of the config tệp tin (httpd-xampp.conf from Step 3).

Listen 8056 SetHandler application/x-httpd-php56-cgi Step 4 (option 3):

To create a virtualhost (localhost56) on a directory (htdocs56) to use PHP v5.6 on http://localhost56, create directory htdocs56 at your desired location andadd localhost56 to lớn your hosts tệp tin (see how),then địa chỉ the following code to lớn the bottom of the config tệp tin (httpd-xampp.conf from Step 3).

DocumentRoot "C:xampphtdocs56" ServerName localhost56 Require all granted SetHandler application/x-httpd-php56-cgi Finish: Save & Restart Apache

Save và close the config file. Restart apache from the xampp control panel. If you went for option 2, you can see the additional port(8056) listed in your xampp control panel.

Share Tweet Linkedin Pinterest
Previous Post

Các hàm của php

Next Post

Check php configuration

CÙNG CHUYÊN MỤC

form register php

Form register php

09/04/2021
fantastic blog (cms) in php with source code

Fantastic blog (cms) in php with source code

28/04/2021
validate form php javascript

Validate form php javascript

28/04/2021
http diendanlequydon com viewtopic php style 6

Http diendanlequydon com viewtopic php style 6

28/04/2021
cách tính năm nhuận trong php

Cách tính năm nhuận trong php

04/07/2022
bản khai đăng ký tên miền

Bản khai đăng ký tên miền

02/07/2022
phần mềm lập trình php tốt nhất

Phần mềm lập trình php tốt nhất

01/07/2022
ghi file trong php

Ghi file trong php

30/06/2022

Newsletter

The most important automotive news and events of the day

We won't spam you. Pinky swear.

Chuyên Mục

  • Hỏi Đáp
  • Kiến Thức
  • Sức Khỏe
  • Tử Vi
  • Công Nghệ

News Post

  • Ung thư thực tràng

About

Chúng tôi tạo ra trang web nhằm mục đích mang lại kiến thức bổ ích cho cộng đồng, các bài viết được sưu tầm từ nhiều nguồn trên internet giúp mang lại kiến thức khách quan dành cho bạn

©2022 darkedeneurope.com - Website WordPress vì mục đích cộng đồng

Liên Hệ - Giới Thiệu - Nội Quy - Bảo Mật

No Result
View All Result
  • Trang chủ
  • Chuyên mục
    • Hỏi Đáp
    • Kiến Thức
    • Sức Khỏe
    • Tử Vi
    • Công Nghệ
  • Lưu trữ
  • Liên hệ

© 2022 darkedeneurope.com - Website WordPress vì mục đích cộng đồng.