Help for integrating the Laravel package
Forum rules: Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
#5540 by netman2002
25 Jan 2018, 06:06
Yes, I guess that something wrong with environment sitting.
One more error ocured when I try to open this path http://test.inf-tec.ru/admin
The login page is successfuly opened if user not logged in. After login proccess the error arrised:

ErrorException thrown with message "file_exists(): open_basedir restriction in effect. File(/usr/share/php/super.php) is not within the allowed path(s): (/home/SHERLAND_AC/web/test.inf-tec.ru/public_html:/home/SHERLAND_AC/tmp:/home/SHERLAND_AC/web/test.inf-tec.ru/laravel/v54:/home/SHERLAND_AC/web/test.inf-tec.ru/laravel/v55:/home/SHERLAND_AC/web/test.inf-tec.ru/laravel/shop:/home/SHERLAND_AC/web/test.inf-tec.ru/laravel/aimeos)"

Stacktrace:
#64 ErrorException in /home/SHERLAND_AC/web/test.inf-tec.ru/laravel/aimeos/vendor/aimeos/aimeos-core/Bootstrap.php:80
#63 file_exists in /home/SHERLAND_AC/web/test.inf-tec.ru/laravel/aimeos/vendor/aimeos/aimeos-core/Bootstrap.php:80
#62 Aimeos\Bootstrap:autoload in [internal]:0
#61 spl_autoload_call in [internal]:0
#60 is_callable in /home/SHERLAND_AC/web/test.inf-tec.ru/laravel/aimeos/vendor/aimeos/aimeos-core/lib/mwlib/src/MW/View/Helper/Access/Standard.php:46
#59 Aimeos\MW\View\Helper\Access\Standard:transform in /home/SHERLAND_AC/web/test.inf-tec.ru/laravel/aimeos/vendor/aimeos/aimeos-core/lib/mwlib/src/MW/View/Standard.php:88
#58 call_user_func_array in /home/SHERLAND_AC/web/test.inf-tec.ru/laravel/aimeos/vendor/aimeos/aimeos-core/lib/mwlib/src/MW/View/Standard.php:88
#57 Aimeos\MW\View\Standard:__call in /home/SHERLAND_AC/web/test.inf-tec.ru/laravel/aimeos/ext/ai-admin-jqadm/admin/jqadm/src/Admin/JQAdm/Common/Decorator/Page.php:48
#56 Aimeos\Admin\JQAdm\Common\Decorator\Page:setView in /home/SHERLAND_AC/web/test.inf-tec.ru/laravel/aimeos/ext/ai-admin-jqadm/admin/jqadm/src/Admin/JQAdm/Factory.php:71
... and so on

Why the system try to open file /usr/share/php/super.php? I do not understand.

ENVIRONMEN...

The public folder of site in Ubuntu system is: /home/SHERLAND_AC/web/test.inf-tec.ru/public_html/
The Laravel core (and Aimeos) folder is: /home/SHERLAND_AC/web/test.inf-tec.ru/laravel/aimeos/
The index.php in public folder contain the next lines:

...
require __DIR__.'/../laravel/aimeos/vendor/autoload.php';
...
$app = require_once __DIR__.'/../laravel/aimeos/bootstrap/app.php';
...

The Apache .conf file contain the following directives for this virtual host:

<Directory /home/SHERLAND_AC/web/test.inf-tec.ru/public_html>
...
php_admin_value open_basedir /home/SHERLAND_AC/web/test.inf-tec.ru/public_html:/home/SHERLAND_AC/web/test.inf-tec.ru/laravel/aimeos
...
</Directory>
(Without this directive the Laravel not work)

May be I done somthing wrong?
Can you give me the refrence to 'best practice' of how to correctly install Laravel on Ubuntu and configure the Apache (and PHP) settings to succesfuly and secure start the Laraver?
#5546 by netman2002
25 Jan 2018, 13:26
Can you to trace the ./ext/ai-gettext/lib/custom/src/MW/Translation/File/Mo.php file in your environment?

This file contain definition of the class 'Mo' and have the method:

protected function extract()
{
$magic = $this->readInt( 'V' );

if( ( $magic === self::MAGIC1 ) || ( $magic === self::MAGIC3 ) ) { //to make sure it works for 64-bit platforms
$byteOrder = 'V'; //low endian
} elseif( $magic === ( self::MAGIC2 & 0xFFFFFFFF ) ) {
$byteOrder = 'N'; //big endian
} else {
throw new \Aimeos\MW\Translation\Exception( 'Invalid MO file' );
}

$this->readInt( $byteOrder );
$total = $this->readInt( $byteOrder ); //total string count
$originals = $this->readInt( $byteOrder ); //offset of original table
$trans = $this->readInt( $byteOrder ); //offset of translation table

$this->seekto( $originals );
$originalTable = $this->readIntArray( $byteOrder, $total * 2 );
$this->seekto( $trans );
$translationTable = $this->readIntArray( $byteOrder, $total * 2 );

return $this->extractTable( $originalTable, $translationTable, $total );
}

Can you trace with 'dd()' the first five call to readInt() in this method for 'en' file?

My results is:
1: 2500072158
2: 318767104
3: 469762048
4: 3019898880
5: 486539264

I want to compare results.
(The 'en' files in my and your side are equels)