RE: PHP version changer
02-18-2021, 02:41 PM
(This post was last modified: 02-19-2021, 07:35 AM by ccr1969.)
(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";
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)Code:vh_custom_tx
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";