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
Related
i'm having problem on adding mariadb jdbc driver on managed domain with profile=full--> following error
my current configuration
module defined for mariadb
This is the file jar i've used
mariadb-java-client-2.7.1.jar
When you want to configure the data source in domain mode then make sure you install the JDBC Driver as a module on each Host Controller.
As there are no management instruments available on the Host Controllers, you need to execute the module add command on each Host Controller in disconnected mode:
e.g.
disconnected /] module add --name=org.mariadb --resources=mariadb-java-client-2.7.1.jar --dependencies=javax.api,javax.transaction.api
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
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
I'm using Symfony 2 and have this row in my parameters.ini:
database_driver = pdo_pgsql
When I was creating database structure with Doctrine everything was good. But if I want to add some doctrine object to my darabase (insert row), I catch an exception:
What I have to do with this?
Are you sure you're using pdo_pgsql? Are you running on localhost? It might be very certain that you are using pdo_mysql driver instead.
However you have to check the following:
php.ini
extension=pdo.so
extension=pdo_mysql.so
or in your case
extension=pdo.so
extension=pdo_pgsql.so
You can check the phpinfo(); to find out the configured database driver.
In your symfony project you have to check the parameters.ini file in config folder. E.g.
[parameters]
database_driver="pdo_mysql"
database_host="localhost"
Besides try to avoid this error
'stty' is not recognized as an internal or external command,
operable program or batch file.
https://github.com/symfony/symfony/issues/4974
First of all, verify your php.ini file: the extensions php_pdo_pgsql and php_pdo must be enabled. Make sure you apply this changes on php.ini file that your symfony project is using, check this on localhost/path_to_your_project/web/config.php. You know if this extensions are enabled executing the function phpinfo().
This command is also helpfull: php -m. It lists on console all the php modules that are loaded.
Tip: check out you Apache error log, there could be something wrong with the load of your extensions. This file is located according to your server configuration.
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