If your New to Runner or just registered please check your junk mail or spam folder to activate registration . Welcome to Runner ... Movie section will be closing on runner to view movies go to Tell It As It Is for latest movies videos @ https://tellitasitis.ga/

Go Back   Runner > Coding Corner > Php

Php PHP is a general-purpose scripting language especially suited to web development. It was originally created by Danish-Canadian programmer Rasmus Lerdorf in 1994.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-16-2021, 02:41 PM
Runner's Avatar
Runner Runner is offline
Administrator
 
Join Date: Nov 2020
Location: Moose Jaw
Posts: 329
Send a message via Skype™ to Runner
Default PHP version changer For Sentora

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
Reply With Quote
  #2  
Old 02-17-2021, 10:39 PM
Runner's Avatar
Runner Runner is offline
Administrator
 
Join Date: Nov 2020
Location: Moose Jaw
Posts: 329
Send a message via Skype™ to Runner
Default

Quote:
Originally Posted by Runner View Post
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
Quote:
// 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";
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 09:50 PM.


Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Copyright ©2020 - 2021, Runner
Ad Management plugin by RedTyger