sahi and symfony2 - symfony

i would like to test behat, mink and sahi with symfony2
so, in my config_test.yml i have
mink:
base_url: http://localhost/Symfony_Standard_2.0.15_2/symfony/web/app_test.php
default_session: symfony
sahi: ~
and in test.feature
#mink:sahi
Scenario: Open page with products list and check it
Given I am on "/hello"
Then the response should contain "hello"
when i execute i have this
PHP Fatal error: Call to undefined function Buzz\Client\curl_init() in C:\wamp\
www\Symfony_Standard_2.0.15_2\Symfony\vendor\buzz\lib\Buzz\Client\AbstractCurl.p
hp on line 26
help me please,

It seems that you do not have cURL enabled in your WAMP installation.
Actually cURL is not enabled by default in WAMP. The steps to enable it are as follows :
Close WAMP (if running)
Navigate to WAMP\bin\php(your version of php)\
edit php.ini
Search for curl, uncomment extension=php_curl.dll
Navigate to WAMP\bin\Apache(your version of apache)\bin\
edit php.ini
Search for curl, uncomment extension=php_curl.dll
Save both
Restart WAMP

Related

Error building webpage: RStudio + blogdown + Ezhil Theme

I am new to blogdown/hugo themes and want to build a webpage using the Ezhil theme with RStudio. I am following the instructions of blogdown.
In particular, after creating the project on RStudio, I am not able to build/serve the site. If I run serve_site(), I obtain
> blogdown::serve_site()
Launching the server via the command:
/Users/brunoconteleite/Library/Application Support/Hugo/0.84.2/hugo server --bind 127.0.0.1 -p 4321 --themesDir themes -t ezhil -D -F --navigateToChanged
Error: Error building site: logged 1 error(s)
Instead, if I run hugo_build(), I obtain
> blogdown::hugo_build()
Start building sites …
hugo v0.84.2-E0C67958+extended darwin/amd64 BuildDate=2021-06-28T10:59:21Z VendorInfo=gohugoio
ERROR 2021/06/29 13:20:37 instagram shortcode: Missing config value for services.instagram.accessToken. This can be set in config.toml, but it is recommended to configure this via the HUGO_SERVICES_INSTAGRAM_ACCESSTOKEN OS environment variable. If you are using a Client Access Token, remember that you must combine it with your App ID using a pipe symbol (<APPID>|<CLIENTTOKEN>) otherwise the request will fail.
If you feel that this should not be logged as an ERROR, you can ignore it by adding this to your site config:
ignoreErrors = ["error-missing-instagram-accesstoken"]
Total in 40 ms
Error: Error building site: logged 1 error(s)
I tried to add the suggested ignoreErrors = ["error-missing-instagram-accesstoken"] line of code to the config.yalm file but could not address this issue.
You need to turn the TOML code into YAML if your config file has yaml or yml extension.
So, rather than ignoreErrors = ["error-missing-instagram-accesstoken"], add ignoreErrors: "error-missing-instagram-accesstoken" line to your config.yaml file. It should work.

The openssl extension is required for SSL/TLS

I try to run this command
> symfony new my_project_name
But it gave me this error.
[Composer\Exception\NoSslException]
The openssl extension is required for SSL/TLS protection but is not available. If you can not enable the openssl extension, you can disable this error, at your own risk, by setting the 'disable-tls' option to true.
You may need to activate openssl in your php.ini.
To find your current php.ini file execute this command php --ini
Then add this line
;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;
...
extension=openssl <---
Restart php services (task manager > CGI / FastCGI > End task) to be sure to apply modification.
Also, be sure that the php_openssl.dll is inside of your php/installation/path/ext/ directory.
Example :

Oracle 11g / WAMP / Symfony3

It's the first time I work with Symfony and Oracle, I have a problem to connect a Oracle11g database to WAMP, I have tried a lot of tutorials but no one work.
I have enabled the php_pdo_oci extension in WAMP. I have downloaded the Oracle client 32bit: Version 11.2.0.4.0, put the files in c:\instantclient_11_2 and add it to PATH.
I have configured parameters.yml and config.yml but when I try to do a request I get the error:
"CRITICAL - Uncaught PHP Exception Doctrine\DBAL\Exception\DriverException: "An exception occured in driver: could not find driver" at ...\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\AbstractOracleDriver.php line 76"
I'm on Windows 7 Pro 64, WAMP 32.
Try to install pdo_oci8 driver and configure your paramaters.yml like this :
parameters:
database_driver: oci8
database_host: hostname
database_port: '1521'
database_name: dbname
database_user: username
Steps to install php_oci8_11g.dll
First, i have moved to a 64bit version of WAMP.
-Download the "Instant Client Package - Basic" for Windows.Choose your version(64 bit) for me.
-Unzip it to c:\instantclient_11_2
-Edit the PATH environment setting and add c:\instant_11_2 before any other Oracle directories (to be sure put it on the begin of the variable)
-Restart your computer for environment variables to effect
-Now go to your php.ini file and add/uncomment the line
extension=php_oci8_11g.dll
-Save php.ini file
-Download the actual Thread Safe OCI-DLLs from pecl.php.net choose your version (I'm using PHP 5.6 so i get the 2.0.12)
-Unzip OCI-DLLs Zip file and copy all files from this folder to Extensions directory of PHP (php/ext)
-Restart WAMP

Open files in PHPStorm with Vagrant+Symfony application

I know you can open files from Symfony profiler or exception file links using this in project/app/config.yml :
framework:
ide: "phpstorm://open?file=%%f&line=%%l"
More info: http://developer.happyr.com/open-files-in-phpstorm-from-you-symfony-application
However as I'm using vagrant, the file path of the server doesn't match my host.
I have created a PHP web application server in PHPStorm with the propper path mappings, but still doesn't work.
Any ideas?
Thanks
When running your app in a container or in a virtual machine, you can tell Symfony to map files from the guest to the host by changing their prefix. This map should be specified at the end of the URL template, using & and > as guest-to-host separators:
// /path/to/guest/.../file will be opened
// as /path/to/host/.../file on the host
// as /path/to/host/.../file on the host
'phpstorm://%f:%l&/path/to/guest/>/path/to/host/&/foo/>/bar/&...'
Symfony FrameworkBundle Configuration - IDE
The answer given by Jeffry no longer works unfortunately :(. When In configure that with my paths the profiler throws:
ParameterNotFoundException
You have requested a non-existent parameter "f:".
I have configured the path according to this line in the SF docs: This map should be specified at the end of the URL template, which results in this:
phpstorm://open?url=file://%%f&line=%%l&/path/to/guest/>/path/to/host/
However, it does open PHPStorm, but phpstorm does not open the file, so i'm a bit stuck here now.
This solves the issue with the file not opening in PhpStorm from a Vagrant:
phpstorm://open?file=%%f&line=%%l&/path/to/guest/>/path/to/host/
Source: https://youtrack.jetbrains.com/issue/IDEA-65879

Drush install on local server error (Command pm-enable needs a higher bootstrap level)

I am getting an error message in Drush on a local mamp install
PDO::__construct(): [2002] Connection refused (trying to connect via tcp://127.0.0.1:3306) [warning]
environment.inc:517
Command pm-enable needs a higher bootstrap level to run - you will need to invoke drush from a more [error]
functional Drupal environment to run this command.
The drush command 'en devel' could not be executed. [error]
Drush was not able to start (bootstrap) the Drupal database. [error]
Hint: This may occur when Drush is trying to:
* bootstrap a site that has not been installed or does not have a configured database. In this case
you can select another site with a working database setup by specifying the URI to use with the --uri
parameter on the command line. See `drush topic docs-aliases` for details.
* connect the database through a socket. The socket file may be wrong or the php-cli may have no
access to it in a jailed shell. See http://drupal.org/node/1428638 for details.
Drush was attempting to connect to:
Drupal version : 7.21
Site URI : http://default
Database driver : mysql
Database hostname : 127.0.0.1
Database username : root
Database name : geoslate
Default theme : garland
Administration theme: garland
PHP configuration : /private/etc/php.ini
Drush version : 5.8
Drush configuration:
Drupal root : /Applications/MAMP/htdocs/geoslate
Site path : sites/default
Modules path : sites/all/modules
Themes path : sites/all/themes
File directory path: sites/default/files
%paths : Array
my drupal settings needed a port specifying which is on the MAMP home page and for me is 8889

Resources