Using the FOSUserBundle, I needed to override the invalid current password error message given when a user edits their profile.
To customize FOSUserBundle’s English messages, you can override these files:
…by putting new ones here, and editing them as you see fit:
Checking in FOSUserBundle’s validators.en.yml, I saw this:
invalid: 'The entered password is invalid'
It looked like I might be able to edit the invalid current password message here, but when using the Edit Profile form (edit_content.html.twig), I got a different error message:
“This value should be the user’s current password.”
I found that error existing in this Symfony file:
So, how to override it? Credit goes to Geert Van Damme for providing the information I needed.
Create a validators.en.yml file in your app folder like so:
Then, override the message by adding its exact text as the key in your YAML file. For example, to override the password error message mentioned above, you could add this to your validators.en.yml file:
This value should be the user's current password.: Invalid password
I got an error recently when attempting to create a new Symfony project using the following command:
php symfony new project
The error was:
cURL error 60: SSL certificate problem: unable to get local issuer certificate
The fix is to download a cacert.pem file which you can find here: https://gist.github.com/VersatilityWerks/5719158/download
Or you can copy and create a file from the curl site here: https://curl.haxx.se/ca/cacert.pem
For WAMP, you can move the cacert.pem file to the ssl folder here: C:\wamp\bin\php\php5.5.12\extras\ssl (Your exact folder path may differ)
Then, you need to open your php.ini file and add the path to your cacert.pem file. NOTE: If you’re using WAMP, do NOT open the php.ini file in your \apache folder from the wampserver icon in your system tray like this:
Instead, you should open the php.ini in your \php folder. For example:
Open that file, and search for the line with: curl.cainfo
You may see something like this:
Uncomment that line, and give it the path to your cacert.pem file. For example:
curl.cainfo = “c:/wamp/bin/php/php5.5.12/extras/ssl/cacert.pem”
Save your php.ini and your Symfony projects should be created now with no problem.
- cURL error 60: ssl certification issue when attempting to use symfony
- cURL error 60: SSL certificate problem: unable to get local issuer certificate
- Symfony framework installation error WIN | curl error 60: ssl certificate problem resolved – YouTube
If you installed PHPUnit to a Windows machine, but are seeing something like this when running phpunit in Git Bash:
$ phpunit ––version
bash: /c/bin/phpunit: No such file or directory
Then make a duplicate copy of your phpunit.phar file:
And rename the copy to:
PHPUnit should work fine in Git Bash after that, as well as in Windows cmd or PowerShell.
Note: If you don’t care about running it in Windows cmd or PowerShell, then just rename the original phpunit.phar file to phpunit rather than making a copy.