This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

PHP version changer
#2
RE: PHP version changer
(02-17-2021, 06:24 AM)ccr1969 Wrote: PHP version changer
Php_Ver.zpp
if anyone has tested it plz let me know i know im having a issue with writing if its null in vh_custom_tx but if was written b4 it writes to it no issue could be with my concat  my zpp to big to upload here as it has 3 PHP versions in it
Code:
$sql = "UPDATE x_vhosts SET vh_php_tx='$name',vh_custom_tx= SUBSTRING_INDEX(vh_custom_tx,'# STARTPhp', 1),vh_custom_tx= CONCAT_WS(vh_custom_tx,'','$ver')  WHERE vh_id_pk=$id";

Code:
vh_custom_tx
I use concat so i dont overwrite existing data vhost as i noticed lets encrypt does it. doesn't keep the existing stuff removes it . In which we don't want to do we want to keep or existing data in vhost and only over write the php version . Which this does that it searches for and replaces vh_custom_tx= SUBSTRING_INDEX(vh_custom_tx,'# STARTPhp', 1)
Note i'm running a windows server so look at code i'm sure be easy to make functional with linux

Fixed the issue will now write value if Null
Code:
// Where the magic happens
$sql = "UPDATE x_vhosts SET vh_php_tx='$name',vh_custom_tx= COALESCE(vh_custom_tx , '' ),vh_custom_tx= SUBSTRING_INDEX(vh_custom_tx,'# STARTPhp', 1),vh_custom_tx= CONCAT(vh_custom_tx,'','$ver') WHERE vh_id_pk=$id";
Thanks given by:


Messages In This Thread
PHP version changer - by ccr1969 - 02-17-2021, 06:24 AM
RE: PHP version changer - by ccr1969 - 02-18-2021, 02:41 PM
RE: PHP version changer - by spoonman - 02-22-2021, 06:25 AM
RE: PHP version changer - by ccr1969 - 02-22-2021, 06:38 AM
RE: PHP version changer - by ccr1969 - 02-25-2021, 02:02 PM
RE: PHP version changer - by spoonman - 02-25-2021, 09:03 PM
RE: PHP version changer - by ccr1969 - 02-26-2021, 08:13 AM
RE: PHP version changer - by spoonman - 02-28-2021, 02:24 AM
RE: PHP version changer - by ccr1969 - 02-28-2021, 05:53 AM
RE: PHP version changer - by spoonman - 02-28-2021, 06:15 AM
RE: PHP version changer - by ccr1969 - 02-28-2021, 06:49 AM
RE: PHP version changer - by spoonman - 02-28-2021, 10:00 AM
RE: PHP version changer - by ccr1969 - 02-28-2021, 02:32 PM
RE: PHP version changer - by spoonman - 03-01-2021, 01:41 AM
RE: PHP version changer - by ccr1969 - 03-01-2021, 05:04 AM
RE: PHP version changer - by spoonman - 03-01-2021, 05:21 AM
RE: PHP version changer - by ccr1969 - 03-07-2021, 05:34 AM
RE: PHP version changer - by spoonman - 03-07-2021, 08:53 AM
RE: PHP version changer - by ccr1969 - 03-08-2021, 03:22 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
PHP version changer Theo 62 173 ,563 07-18-2023, 10:57 AM
Last Post: ccr1969
Sentastico MediaWiki Requires Newer Version of PHP? dsmarter 1 5 ,903 08-19-2017, 03:45 AM
Last Post: TGates
How to install Select PHP Version cangkirhost 5 32 ,071 11-03-2016, 12:03 PM
Last Post: cangkirhost

Forum Jump:


Users browsing this thread: 1 Guest(s)