Logic Hook good fire on local comp but dont on Server

Hello, all.
I have some one logic hook, that work good on local machine, but don’t work on server.
Both debian 8, LAMP. Local some firing field, Server for work.
PHP file is two part, first part work only in local, second work on both.
I check all var iv vardefs.php on both machines, its identical.
Help me plz to fix this bug.

Hoock file:

<?php $hook_version = 1; $hook_array = Array(); $hook_array['before_save'] = Array(); $hook_array['before_save'][] = Array( 2, 'lastprice', 'custom/Extension/modules/custom_Buy_Sale/lastprice.php', 'lastprice', 'getoldprice' ); /lastprice.php: <?php if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); class lastprice { function getoldprice ($bean, $event, $arguments) { //first part $price=$bean->price; $name=$bean->name; $buysaleBean = BeanFactory::getBean('custom_Buy_Sale'); $buysaleBean -> retrieve_by_string_fields( array( 'name' => $name )); if ($price != ($buysaleBean->price)) { $bean->last_price = ($buysaleBean->price); } //second part $tot_ar=$bean->total_area; $bean->cost_per_unit=$price/$tot_ar; } } Thanks.

is not firing or is not doing even it’s getting fired?

check your webserver logs

best regards

Thanks.
It’s not doing half event of php file.
Logs is empty.

Is the hook in the extension folder? if so need to repair and rebuild.
Also hook should be defined(don’t know if this is a copy and paste issue?)

$hook_array['before_save'][] 

Thanks.
Hook is in /modules/custom_Buy_Sale folder/
So, $hook_array[‘before_save’][] is realy copy-paste issue, in file that code same as pointed ($hook_array[‘before_save’][]).
Q r&r is well done at begin.
Is anybody have any idea?
Thanks.