php tokenizer extension symfony

Questions and mods regarding system management may go here
Forum rules
We've moved! Head over to Synology Community (community.synology.com) to meet up with our team and other Synology enthusiasts!
casope
I'm New!
I'm New!
Posts: 2
Joined: Mon Mar 21, 2016 9:53 am

php tokenizer extension symfony

Unread post by casope » Mon Mar 21, 2016 10:07 am

Hi, I´m try to install symfony on my ds215j with DSM 6. I used the symphony installer, but when i try to create a new project, once the process is ended, I get this error:
Preparing project... ✕ Symfony 3.0.3 was successfully installed but your system doesn't meet its technical requirements! Fix the following issues before executing your Symfony application:
* token_get_all() must be available > Install and enable the Tokenizer extension.

If i look at the php documentation, this extension (Tokenizer) is built in since php 4.3 are enable by default.
Any idea?

User avatar
avluis
Beginner
Beginner
Posts: 24
Joined: Sat Dec 27, 2014 2:13 am
Contact:

Re: php tokenizer extension symfony

Unread post by avluis » Mon Mar 21, 2016 12:52 pm

I believe it is actually the Windows version of PHP that has built-in tokenizer support - in the case of PHP for DSM, it would have to had been built with support enabled - I'm not aware of what flags Synology uses when they build their PHP distro, but I know that they don't include many extensions from the get go, so you'll either have to build them yourself (this is a very painful process, but doable, you'll have to research this since it takes a lot of time, patience and a proper system set-up for this) or hope that they include it in some sort of downloadable pack.

This reminds me of an earlier promise from them to provide more PHP extensions, which of course, has yet to happen.

jdaviaud
I'm New!
I'm New!
Posts: 2
Joined: Thu Mar 24, 2016 9:57 pm

Re: php tokenizer extension symfony

Unread post by jdaviaud » Thu Mar 24, 2016 9:59 pm

Yes need it too, symfony need it for example for the Fos User Bundle, bundle a lot of symfony devs are using

Thanks in advance

jdaviaud
I'm New!
I'm New!
Posts: 2
Joined: Thu Mar 24, 2016 9:57 pm

Re: php tokenizer extension symfony

Unread post by jdaviaud » Sat Mar 26, 2016 12:13 am

If it can help others, i found how ...

the main php we use in CLI is the old one ...

The one used by DSM 6.X is named php56

so we can you "php56 symfony.phar OUR_COMMAND" "php56 composer.phar OUR_COMMAND" etc.

Not a final solution, but i have all i need for the moment ;)

randomusername
I'm New!
I'm New!
Posts: 4
Joined: Mon Apr 18, 2016 11:54 pm

Re: php tokenizer extension symfony

Unread post by randomusername » Tue Apr 19, 2016 12:08 am

jdaviaud wrote:If it can help others, i found how ...

the main php we use in CLI is the old one ...

The one used by DSM 6.X is named php56

so we can you "php56 symfony.phar OUR_COMMAND" "php56 composer.phar OUR_COMMAND" etc.

Not a final solution, but i have all i need for the moment ;)
Great find, had the same problem with Zend Framework on Synology today. Now I have different errors, that's progress. :mrgreen:
Thanks for the workaround.

3thereal
Student
Student
Posts: 66
Joined: Wed Aug 10, 2011 3:38 am

Re: php tokenizer extension symfony

Unread post by 3thereal » Wed Jun 15, 2016 3:04 pm

Did anyone figure this out at all? I need to get tokenizer working too for composer. My Diskstation is already using php 5.6 on DSM 6.0.1

BenediktGer
I'm New!
I'm New!
Posts: 2
Joined: Sun Jun 19, 2016 2:43 pm

Re: php tokenizer extension symfony

Unread post by BenediktGer » Sun Jun 19, 2016 2:48 pm

After doing some digging around, I found the solution to this problem:

DSM 6.x comes with two PHP installations. The first one is php which is used by the internal DSM web server which serves the DSM Control panel. The second one is php56 which is used by the web station. A composer installation usually defaults to php and we need change that.

First we go into the web station and check whether the PHAR extension is activated. Once we made sure that it is activated we switch to the terminal, change into the directory where composer is sitting and run it in the following way:

Code: Select all

php56 composer.phar
This should fix your problem.

3thereal
Student
Student
Posts: 66
Joined: Wed Aug 10, 2011 3:38 am

Re: php tokenizer extension symfony

Unread post by 3thereal » Mon Jun 20, 2016 1:12 am

Composer is sitting in /user/local/bin, if I go there and run php56 composer.phar it just says cannot open input file.

BenediktGer
I'm New!
I'm New!
Posts: 2
Joined: Sun Jun 19, 2016 2:43 pm

Re: php tokenizer extension symfony

Unread post by BenediktGer » Mon Jun 20, 2016 9:06 am

Try

Code: Select all

chmod +x composer.phar
This grants execution rights to the file.

3thereal
Student
Student
Posts: 66
Joined: Wed Aug 10, 2011 3:38 am

Re: php tokenizer extension symfony

Unread post by 3thereal » Mon Jun 20, 2016 3:26 pm

I still get: PHP Warning: Phar::mapPhar(): open_basedir restriction in effect. File(/usr/local/bin/composer) is not within the allowed path(s): (/etc.defaults:/etc:/usr/syno/synoman:/tmp:/var/services/tmp:/var/services/web:/var/services/homes) in /usr/local/bin/composer on line 23

Which I don't get, I've added /usr/local/bin to my allowed paths in /etc/profile, so I'm not sure why I would be getting a lot of those errors.

Ferdinandum
I'm New!
I'm New!
Posts: 1
Joined: Sun Mar 26, 2017 12:25 pm

Re: php tokenizer extension symfony

Unread post by Ferdinandum » Sun Mar 26, 2017 6:03 pm

Good afternoon

I am trying to run symfony on DSM 6.0. For that:

1º - Web Station / PHP Settings / PHP 5.6 / Activate phar Extension

2º - I check that there is no composer.phar in the NAS ¿Is Correct?
2.1 - Download composer.phar with the following command:

Code: Select all

curl -s http://getcomposer.org/installer | php56
2.2 - I move the file to /usr/local/bin

Code: Select all

mv composer.phar /usr/local/bin/composer.phar
2.3 - I give it permissions

Code: Select all

chmod +x composer.phar
3º -I execute: php56 composer.phar but i have this error:

Code: Select all

PHP Warning:  Unknown: open_basedir restriction in effect. File(composer.phar) is not within the allowed path(s): (/etc.defaults:/etc:/usr/syno/synoman:/tmp:/var/services/tmp:/var/services/web:/var/services/homes) in Unknown on line 0
PHP Warning:  Phar::mapPhar(): open_basedir restriction in effect. File(/usr/local/bin/composer.phar) is not within the allowed path(s): (/etc.defaults:/etc:/usr/syno/synoman:/tmp:/var/services/tmp:/var/services/web:/var/services/homes) in /usr/local/bin/composer.phar on line 23
PHP Warning:  require(): open_basedir restriction in effect. File(composer.phar) is not within the allowed path(s): (/etc.defaults:/etc:/usr/syno/synoman:/tmp:/var/services/tmp:/var/services/web:/var/services/homes) in /usr/local/bin/composer.phar on line 24
PHP Warning:  require(phar://composer.phar/bin/composer): failed to open stream: phar error: invalid url or non-existent phar "phar://composer.phar/bin/composer" in /usr/local/bin/composer.phar on line 24
PHP Fatal error:  require(): Failed opening required 'phar://composer.phar/bin/composer' (include_path='.') in /usr/local/bin/composer.phar on line 24
I need help, thx
Ferdinandum

Locked

Return to “System Managment Mods”