undefined variable when using cb 2.0 plugin

Ch3vr0n

Verified User
Joined
Aug 24, 2014
Messages
88
New DA server setup after migrating from a previous host. CB 2.0 plugin installed. Running updates yields at the top

Executing /usr/local/directadmin/plugins/custombuild/admin/build update_versions
Warning: Undefined variable $filePath in /usr/local/directadmin/plugins/custombuild/admin/build_software_command.raw on line 15

any suggestions on a fix?
 
What version DirectAdmin do you use?

If you use version 1.645 or newer then you should not need to install the CustomBuilds plugin as CustomBuilds is noe part if DirectAdmin itself.

 
I only just updated to 1.645 with the custombuilds plugin. Was previously 1.644. The plugin was installed because i like "enhanced" skin better for administration. I feel like i need to look around for things too much under the "evolution" skin. Evolution is enabled though for individual (customer) domains
 
I am in a similar situation, custombuild 2 was already installed on a server, DA self updated on Dec 2 to 1645 and now I get "
Warning: Undefined variable $filePath in /usr/local/directadmin/plugins/custombuild/admin/build_software_command.raw on line 15
#=#=# "

Also when I go to the plugin to update software I get: "Warning: Undefined array key "version" in /usr/local/directadmin/plugins/custombuild/admin/tabs/custom_build_block.php on line 4"

So wondering do I have to remove the plugin from plugins or will that break more than it fixes?
 
@netearth
Please switch to Evolution Skin, old skin will not update new feature any more. Like Custombuild 2.0 that part of Directadmin itself.
 
More info here


Sometime in the future it won’t work at all anymore.
 
I am in a similar situation, custombuild 2 was already installed on a server, DA self updated on Dec 2 to 1645 and now I get "
Warning: Undefined variable $filePath in /usr/local/directadmin/plugins/custombuild/admin/build_software_command.raw on line 15
#=#=# "

Also when I go to the plugin to update software I get: "Warning: Undefined array key "version" in /usr/local/directadmin/plugins/custombuild/admin/tabs/custom_build_block.php on line 4"

So wondering do I have to remove the plugin from plugins or will that break more than it fixes?
That doesn't answer the question if uninstalling the plugin will break anything, does it? I'm not switching to evolution until i know, and wwhere is the that plugin functionality then found under evolution.
 
That doesn't answer the question if uninstalling the plugin will break anything, does it? I'm not switching to evolution until i know, and wwhere is the that plugin functionality then found under evolution.
Well, you can get to it in evolution under the 4 circles >> extra features >> custombuild. The evolution skin is nice, but, not as good as the enhanced one, I'm old - dont like change and it takes me time to change - thats not DA's fault, thats just me :cool:
 
The evolution skin is nice, but, not as good as the enhanced one,
Couldn't have said it any better, while evolution is nice and responsive. It's not as easy to work with as enhanced.

That said, still doesn't answer the question if uninstalling the plugin is gonna break anything.
 
And my vote too. Maybe we can start a feature request for it?

Having that said, I doubt that this issue is caused by the Enhanced skin, we are running Enhanced too for the admins and do not have issues with the CB 2.0 plugin.

However, we never update using the plugin, always via SSH commandline.
 
Anyway, anyone any suggestions on the initial issue?

Executing /usr/local/directadmin/plugins/custombuild/admin/build update_versions
Warning: Undefined variable $filePath in /usr/local/directadmin/plugins/custombuild/admin/build_software_command.raw on line 15
 
New DA server setup after migrating from a previous host. CB 2.0 plugin installed. Running updates yields at the top

Executing /usr/local/directadmin/plugins/custombuild/admin/build update_versions
Warning: Undefined variable $filePath in /usr/local/directadmin/plugins/custombuild/admin/build_software_command.raw on line 15

any suggestions on a fix?

Try and copy your system php.ini to /usr/local/directadmin/plugins/custombuild/php.ini if it does not exist. Then update error_reporting in it to not show warnings.

See https://www.php.net/manual/en/errorfunc.configuration.php for more details.
 
if it does not exist.
I dont have a php.ini in that directory on any server. Seems php is working but the variable is not defined.

Now I checked and this should be line 15 and 16:
Code:
$process->run($filePath);
$filePath = '/usr/local/directadmin/plugins/custombuild/logs/' . $timestamp . '.' . $process->getPid() . '.log';

So I searched the forums for this error because I vaguely remembered seeing something like this.

And yes indeed. Seemed somebody found a solution there.
I just don't understand why I don't run in to this issue or others having the same file without that 1 extra line mentioned in the solution.

Anyway, maybe that solution helps.
 
It's said there a default value is E_ALL.
Ah oke so you mean, it's just a warning which can be ignored in fact. But if I understand the script correctly, then the log might not work as the filepath is undefined, so unknown.

But indeed changing the E_ALL would let de warning be made silent.
 
Ah oke so you mean, it's just a warning which can be ignored in fact. But if I understand the script correctly, then the log might not work as the filepath is undefined, so unknown.


Based on the code you've posted, I' suggest that you switch the order of the lines. To make logs working bring the lines to the following view:

PHP:
$filePath = '/usr/local/directadmin/plugins/custombuild/logs/' . $timestamp . '.' . $process->getPid() . '.log';
$process->run($filePath);

It should solve the issue.
 
It should solve the issue.
That would be the solution for @Ch3vr0n then. I didn't see the warning yet, I just posted as how line 15 and 16 look in that file on my server. And a possible link to a solution.
Odd thing is that there was suggested to post that $process->run($filePath); above the line with .log at the end.

Anyway. @Ch3vr0n has something he can test with now. ;)
Thanks!
 
not that experienced with command line. I'll look into it, though i don't have a problem with php. Though as also asked, would simply uninstalling the seperately installed plugin fix things?
 
Back
Top