Symfony2 : How to make the php_intl extension available for Symfony2? - forms

I'm trying to follow this documentation on Symfony : http://symfony.com/doc/current/book/forms.html
ok so here is my thing, I've externalised my form and created a specific form class for handling the process and being able to reuse it.
So what happen when I submit the form, whatever the info are okay or not for my class, I get this fatal Error :
Fatal error: Call to a member function setAttribute() on a non-object
in C:\Program Files
(x86)\wamp\www\QNetworks\vendor\symfony\src\Symfony\Component\Form\Extension\Core\DataTransformer\NumberToLocalizedStringTransformer.php
on line 130 Call Stack
I'm running with php 5.3.9 and my intl extension is installed and activated BUT when I run the app/check.php command I see :
[[WARNING]] Checking that the intl extension is available: FAILED
* Install and enable the intl extension (used for validators) *
So I don't understand what the problem with this extension. Should I reinstall it ?
When I go here : http://php.net/manual/en/intl.requirements.php
I see tht i can install the PECL or the ICU library, but i don't know if I should and if there is any relation with my problem ..

Your Intl extention must be configured propertly.
Check on your server if this really activated using phpinfo()
then on your php.ini activate logging:
[intl]
intl.error_level = E_WARNING
extension=php_intl.dll
and check logs
If it's activated maybe it's a malfunction. Try to redownload the dll into c:\PHP\ext\php_intl.dll

take care you have two php.ini :
*wamp\bin\php\php5.3.13
*wamp\bin\apache\apache2.2.22\bin
you should uncomment extension=php_intl.dll in both.

After enable intl extension, you need copy some files to apache bin directory. It could help you: http://www.youtube.com/watch?v=gtIcpdPzXiE

Related

Init grpc in flutter project

I create flutter project with grpc, but I get error, when try to generate file dart from proto. I put proto files in lib/protos (rewards.proto), then in terminal put command
'protoc --dart_out=grpc:lib/src -Iprotos protos/rewards.proto'
and I receiver error like this --dart_out: protoc-gen-dart: ═х єфрхЄё  эрщЄш єърчрээ√щ Їрщы.
What I do wrong ? (Sorry for my English):)
Follow this official installation docs : grpc-dart
I hope you downloaded the protoc-plugin. You can do it using
$ dart pub global activate protoc_plugin
If you had already done this, add dart to path, You can do this
export PATH="/path/to/.pub-cache/bin:$PATH"
export PATH="/path/to/dart-sdk/bin:${PATH}"
ps : The error you got is due to path related issues. The above two commands might help

PHP Fatal error: Class 'RemoteWebElement' not found in

I have a symfony project that run normal in command line:
php app/console server:run
But, I want to run inside PhpStorm. When I try to do this, it gives the fatal error:
PHP Fatal error: Class 'RemoteWebElement' not found in
I already tried to look the oficial documentation of the classe:
http://facebook.github.io/php-webdriver/classes/RemoteWebElement.html. But I didn't found information that culd help me.
I also added the compose dependency:
composer require facebook/webdriver
But had no effect!
=======================================
I'll explain step-step how to get this the bug (It will be very long!):
I have:
PHP 5.5.9
PhpStorm 10.0.3
composer 1.0-dev (7117a5775ffdcdfd31bbd52a138a6f9c65e7e3c2) 2016-02-03
So, create a new symfony project (current version 3.0) and add composer dependencies:
symfony new project
cd project
composer update
Then, open this project inside of phpstorm and I configure settings for to run the project:
Settings -> Languages & Frameworks -> PHP
"PHP language level": 5.5
"Interpreter": 5.5.9
Add through plus(+) the PHP folder:
/usr/share/php
Click 'OK'
Now, try to run de project through PhpStorm by the shortcut:
Ctrl+Shif+F10.
Will appear the bug:
PHP Fatal error: Class
'Symfony\Bundle\FrameworkBundle\Test\WebTestCase' not found in
Solve this by this way inside of PhpStorm:
Settings -> Languages & Frameworks -> PHP -> PHPUnit
Choose: "Use custom autoloader"
And, in the field "Path to script", informe the autoloader's address. For example:
/home/murilo/git/slu/app/autoload.php. Click 'OK'.
Again, try to run de project through PhpStorm by the shortcut:
Ctrl+Shif+F10
Will appear the bug:
PHP Fatal error: Class 'Doctrine\Tests\Common\Cache\CacheTest' not
found in
Solve this through this command inside the project folder:
composer require maslosoft/cachetest:dev-master -n --no-progress
For the last time, try to run de project through PhpStorm by the shortcut:
Ctrl+Shif+F10
Will appear the bug:
PHP Fatal error: Class 'RemoteWebElement' not found in
I'm at this bug.
Please, someone knows how I can overcome this bug? o.O
I struggled with the same exact issue as you have described. After breaking my head for most of the day with this problem, I found the issue.
When you execute the command php app/console server:run in command line, it sets up a server and runs the website. However, when you run the project in PHPStorm, it doesn't actually run it as a server but runs it as a PHPUnit. What you need to do is configure a PHP Web Application in PHPStorm and run that.
Check the image below where I have configured the website. When I run the Web Application, it will run by the url and it will show up in your browser.

MongoClient not found in WAMP

I have been trying to run MongoDB on WAMP all day and It shows the error: Fatal Error: MongoClient class not found. I have a windows 64 bit, Wamp 32 bit ( after trying and failing at running wamp 64), MongoDB 64 bit. I downloaded mongo php_driver from https://s3.amazonaws.com/drivers.mongodb.org/php/index.html. Copied php_mongo-1.5.1-5.4-vc9.dll to the php extension folder as php_mongo.dll. Added it as extension in php.ini (configuration setting file). My php.ini extension section looks like this:
extension=php_bz2.dll
extension=php_curl.dll
extension=php_com_dotnet.dll
extension=php_fileinfo.dll
extension=php_gd2.dll
extension=php_gettext.dll
extension=php_gmp.dll
extension=php_intl.dll
extension=php_imap.dll
;extension=php_interbase.dll
extension=php_ldap.dll
extension=php_mbstring.dll
extension=php_exif.dll ; Must be after mbstring as it depends on it
extension=php_mysql.dll
extension=php_mysqli.dll
;extension=php_oci8.dll ; Use with Oracle 10gR2 Instant Client
;extension=php_oci8_11g.dll ; Use with Oracle 11gR2 Instant Client
extension=php_openssl.dll
;extension=php_pdo_firebird.dll
extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
extension=php_shmop.dll
extension=php_mongo.dll
I've reboot the server. I don't see Mongo on the phpinfo() file and also the php error log files shows the following:
c:/wamp/bin/php/php5.5.12/ext/php_intl.dll' - The specified module could not be found.
PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.5.12/ext/php_ldap.dll' - %1 is not a valid Win32 application.
PHP Warning: PHP Startup: mongo: Unable to initialize module
Please tell me what I am missing because I have tried everything.
Thank you!
To fix the php_intl.dll error do the following using the wmapmanager menus
wampmanager -> Apache -> Version -> and click on the 2.4.9 version number
This will cause wampmanager to rebuild all the SYMLINKS in the \wamp\bin\apache\apache2.4.9\bin folder.
As to the mongo error, are you sure you are editing the correct php.ini file.
Again use the wampmanager menu system to edit the correct php.ini file
wampmanager -> PHP -> php.ini
I expect the extension was not added to this file so add
extension=php_mongo.dll
like you did to the PHP CLI version of the ini file.

How to use the plugin sfTCPDFPlugin?

I work with symfony 1.4, and I want to use the plugin sf sfTCPDFPlugin.
I followed step by step all the instructions, I read the question “How to generate PDF using sfTCPDFPlugin in symfony 1.4?” and answers, but when I try to generate a PDF file, I get the following error:
The server returned a "500 Internal Server Error".
In detail, I have done the following:
I installed PEAR - PHP Extension, and run OK.
I installed
successfully the plugin sfTCPDFPlugin
I downloaded and installed
the "TCPDF library"
$ symfony plugin:publish-assets
$ symfony cc
Copy the /plugins/sfTCPDFPlugin/config/pdf_configs.yml into the config folder of your application
Now I try to test the plugin, but when I want to run the function "test" that is included in the plugin, I get the following error:
The server returned a "500 Internal Server Error":
PHP Fatal error: Class 'TCPDF' not found in D:\proyectos\conflictosnew\plugins\sfTCPDFPlugin\lib\sfTCPDF.class.php on line 14
I use Wampsever under Windows XP
Any idea what could be happening?
I have found an error! The link contained in: "Download the TCPDF library" at: http://www.symfony-project.org/plugins/sfTCPDFPlugin, is incorrect, because download fonts only, not the complete library
In the following link you can find the complete library TCPDF:
http://sourceforge.net/projects/tcpdf/files/

Symfony 1.4x and sfTCPDFPlugin

I have installed sfTCPDFPlugin in my project, but when I try to test if the installation is alright (with the source found on the official site) I get the error:
Fatal error: Class 'TCPDF' not found in C:\wamp\www\mairie\plugins\sfTCPDFPlugin\lib\sfTCPDF.class.php on line 12
How can I fix it?
Read the readme tab here : http://www.symfony-project.org/plugins/sfTCPDFPlugin
It says you have to download the tcpdf library, not only the sfTCPDFPlugin.
i faced with same problem, and i did the following task it will also help you.
first of all run: symfony plugin:uninstall sfTCPDFPlugin then remove the sfTCPDFPlugin directory form your plugin folder.
mow do the following setps:
1. cd your project path/symfony
2. symfony plugin:install sfTCPDFPlugin
3. download the tcpdf library unzip it and past into your sfTCPDFPlugin/lib now your directory looks like your project path/symfony/plugins/sfTCPDFPlugin/lib/tcpdf
now change your ProjectConfiguration.class.php to add $this->enablePlugins( array('sfTCPDFPlugin') ); now run the symfony plugin:publish-asstes and finally clear the cache symfony cc.