I have installed WAMP server with following details
1. Apache httpd 2.2.22
2. PHP 5.4.3
3. MySQL 5.5.24
I want to run Symfony2 on this so I downloded this
Symfony_Standard_Vendors_2.2.1
And tried to make application from it
I am getting following error for it
1/1 InvalidArgumentException: There is no extension able to load the configuration for "framework" (in D:\Program files\wamp\www\Symfony\app/config/config_dev.yml). Looked for namespace "framework", found "security", "twig", "monolog", "swiftmailer", "assetic", "doctrine", "sensio_framework_extra", "jms_aop", "jms_di_extra", "jms_security_extra", "acme_demo", "web_profiler", "sensio_distribution"
in D:\Program files\wamp\www\Symfony\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\Loader\YamlFileLoader.php line 268
at YamlFileLoader->validate(array('imports' => array(array('resource' => 'config.yml')), 'framework' => array('router' => array('resource' => '%kernel.root_dir%/config/routing_dev.yml'), 'profiler' => array('only_exceptions' => false)), 'web_profiler' => array('toolbar'
=> true, 'intercept_redirects' => false), 'monolog' => array('handlers' => array('main' => array('type' => 'stream', 'path'
=> '%kernel.logs_dir%/%kernel.environment%.log', 'level' => 'debug'), 'firephp' => array('type' => 'firephp', 'level' => 'info'), 'chromephp' => array('type' => 'chromephp', 'level' => 'info'))), 'assetic' => array('use_controller' => true)), 'D:\Program files\wamp\www\Symfony\app/config/config_dev.yml') in D:\Program files\wamp\www\Symfony\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\Loader\YamlFileLoader.php line 238
at YamlFileLoader->loadFile('D:\Program files\wamp\www\Symfony\app/config/config_dev.yml') in D:\Program files\wamp\www\Symfony\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\Loader\YamlFileLoader.php line 42
at YamlFileLoader->load('D:\Program files\wamp\www\Symfony\app/config/config_dev.yml', null) in D:\Program files\wamp\www\Symfony\vendor\symfony\symfony\src\Symfony\Component\Config\Loader\DelegatingLoader.php line 52
at DelegatingLoader->load('D:\Program files\wamp\www\Symfony\app/config/config_dev.yml') in D:\Program files\wamp\www\Symfony\app\AppKernel.php line 36
at AppKernel->registerContainerConfiguration(object(DelegatingLoader)) in D:\Program files\wamp\www\Symfony\app\bootstrap.php.cache line 653
at Kernel->buildContainer() in D:\Program files\wamp\www\Symfony\app\bootstrap.php.cache line 593
at Kernel->initializeContainer() in D:\Program files\wamp\www\Symfony\app\bootstrap.php.cache line 378
at Kernel->boot() in D:\Program files\wamp\www\Symfony\app\bootstrap.php.cache line 409
at Kernel->handle(object(Request)) in D:\Program files\wamp\www\Symfony\web\app_dev.php line 26
Not able to understand, how solve this problem ?
or where is the issue ?
Have you ran check.php, config.php as nicely described in the README.md? I would also recommend to use Symfony with composer, instead of with vendors. Please check the documentation for a proper setup.
This kind of error is usually thrown if you forgot to register a bundle and have already put bundle-specific configurations into app/config/config.yml.
The 'framework' configuration namespace is provided by the FrameworkBundle.
Please make sure you have FrameworkBundle registered in your app/AppKernel.php
<?php
[...]
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
[...]
Please also clear your cache with app/console cache:clear ( probably not working aswell ) or remove the contents of app/cache folder manually.
Related
Very new to php unit and can't exactly work out whats wrong. My class is as follows:
<?php
include $_SERVER['DOCUMENT_ROOT'] . '/assets/php/global_php_includes.php';
use PHPUnit\Framework\TestCase;
final class PesticideTests extends TestCase {
public function addPesticideTest() {
$data = array(
"code" => randomString(16),
"created_by" => $_SESSION['userCode'],
"company_code" => "TEST_COMPANY",
"crop_code" => "TEST_CROP",
"content" => "TEST_CONTENT",
"comments" => "TEST_COMMENTS",
"function" => "TEST_FUNCTION",
"pcs_no" => 0123,
"phi" => "TEST_PHI",
"product_name" => "TEST_PRODUCT",
"substance" => "TEST_SUBSTANCE",
"date_of_reg_review" => "01-01-0001",
"use_by_date" => "01-01-0001",
"off_label_approval" => "TEST_OFF_LABEL_APPROVED",
"latest_time_of_application" => "TEST_LATEST_TIME_OF_APPLICATION",
"max_individual_dose" => "TEST_MAX_INDIVIDUAL_DOSE",
"max_total_dose" => "TEST_MAX_TOTAL_DOSE",
"max_no_applications" => "TEST_MAX_NO_APPLICATIONS",
"method_of_application" => "TEST_METHOD_OF_APPLICATION",
"status" => 'inactive'
);
$result = addPesticide($connection, $data);
$this->assertEquals(1, $result);
}
}
the command I run to test it is ./vendor/bin/phpunit tests/PesticideTests.php
and the error I get is
PHP Warning: include(/assets/php/global_php_includes.php): failed to open stream: No such file or directory in C:\xampp\htdocs\tapp\tests\PesticideTests.php on line 3
Warning: include(/assets/php/global_php_includes.php): failed to open stream: No such file or directory in C:\xampp\htdocs\tapp\tests\PesticideTests.php on line 3
PHP Warning: include(): Failed opening '/assets/php/global_php_includes.php' for inclusion (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\tapp\tests\PesticideTests.php on line 3
Warning: include(): Failed opening '/assets/php/global_php_includes.php' for inclusion (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\tapp\tests\PesticideTests.php on line 3
PHPUnit 9.5.2 by Sebastian Bergmann and contributors.
W 1 / 1 (100%)
Time: 00:00.014, Memory: 4.00 MB
There was 1 warning:
1) Warning
No tests found in class "PesticideTests".
WARNINGS!
Anyone have any idea what I'm doing wrong? If I also run it as just ./vendor/bin/phpunit tests then I get the error "No tests found". Pretty confused
EDIT:
I have fixed the test not being found by naming it by the wrong convention, still getting an error for the include file
When running your code withing phpunit there is no $_SERVER['DOCUMENT_ROOT'] set. This only gets set when running in the context of a webserver. Just replace this with the directory where the assets directory is.
I have installed OroCommerce, a Symfony2 based application. I want to have the 'vendor' directory on a higher level outside the users directory. I followed the steps at http://symfony.com/doc/current/configuration/override_dir_structure.html#override-the-vendor-directory but now the namespaces can't be found. I get the following error:
InvalidArgumentException in YamlFileLoader.php line 399: There is no extension able to load the configuration for "framework" (in /home/oro2/public_html/app/config/config_dev.yml). Looked for namespace "framework", found "web_profiler", "sensio_distribution", "debug"
in YamlFileLoader.php line 399
at YamlFileLoader->validate(array('imports' => array(array('resource' => 'config.yml')), 'framework' => array('router' => array('resource' => '%kernel.root_dir%/config/routing_dev.yml'), 'profiler' => array('only_exceptions' => false)), 'web_profiler' => array('toolbar' => true, 'intercept_redirects' => false), 'monolog' => array('handlers' => array('main' => array('type' => 'stream', 'path' => '%kernel.logs_dir%/%kernel.environment%.log', 'level' => 'debug'))), 'oro_assetic' => array('css_debug' => null, 'css_debug_all' => false), 'oro_message_queue' => array('client' => array('traceable_producer' => true))), '/home/oro2/public_html/app/config/config_dev.yml') in YamlFileLoader.php line 369
at YamlFileLoader->loadFile('/home/oro2/public_html/app/config/config_dev.yml') in YamlFileLoader.php line 44
at YamlFileLoader->load('/home/oro2/public_html/app/config/config_dev.yml', null) in DelegatingLoader.php line 45
at DelegatingLoader->load('/home/oro2/public_html/app/config/config_dev.yml') in AppKernel.php line 35
at AppKernel->registerContainerConfiguration(object(DelegatingLoader)) in bootstrap.php.cache line 2776
at Kernel->buildContainer() in bootstrap.php.cache line 2728
at Kernel->initializeContainer() in OroKernel.php line 290
at OroKernel->initializeContainer() in bootstrap.php.cache line 2507
at Kernel->boot() in OroKernel.php line 252
at OroKernel->boot() in bootstrap.php.cache line 2538
at Kernel->handle(object(Request)) in app_dev.php line 33
Am I forgetting something? Does anyone know how to solve this problem?
You are somewhere calling %kernel.root_dir%/config/routing_dev.yml which actually does not exist, because you have moved the config file dir
I installed a package in Laravel 5.2 named jonnywilliamson/laragram
And put in config\app.php a alias and service provider like below :
'providers' => [
.
.
.,
Illuminate\Translation\TranslationServiceProvider::class,
Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class,
Williamson\Laragram\Laravel\LaragramServiceProvider::class,
]
'aliases' => [
.
.
.,
'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
'TG' => Williamson\Laragram\Laravel\LaragramFacade::class,
]
And in my contoller :
use TG;
public function test()
{
return TG::sendMsg('+989118000000', 'Hello there!');
}
And route:
Route::get('test', 'Services\Auth\Controller\v1_0\AuthController#test');
I also run the following commands :
composer dumpautoload
composer dumpautoload -o
php artisan cache:clear
php artisan clear-compiled
php artisan optimize
But still shows error like:
RuntimeException in Facade.php line 210:
A facade root has not been set.
in Facade.php line 210
at Facade::__callStatic('sendMsg', array('+989118000217', 'Hello there!')) in User.php line 68
at LaragramFacade::sendMsg('+989118000217', 'Hello there!') in User.php line 68
at AuthController->test('fa')
at call_user_func_array(array(object(AuthController), 'test'), array('lang' => 'fa')) in Controller.php line 80
at Controller->callAction('test', array('lang' => 'fa')) in ControllerDispatcher.php line 146
at ControllerDispatcher->call(object(AuthController), object(Route), 'test') in ControllerDispatcher.php line 94
at ControllerDispatcher->Illuminate\Routing\{closure}(object(Request))
How can i fix it?
The function you are trying to call is called sendMessage:
return TG::sendMessage('+989118000000', 'Hello there!');
You are using sendMsg, which is causing the error.
im working in SmFony Project but i got some issues when i would get access on my poject via this URL : http://localhost/oksa-depannage/web/app_dev.php/login
"OKSA-DEPANNAGE" is a project name.
So i hope that my question is clear
Errors :
in C:\wamp\www\oksa-depannage\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\ParameterBag\ParameterBag.php line 106
at ParameterBag->get('java_path') in C:\wamp\www\oksa-depannage\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\ParameterBag\ParameterBag.php line 232
at ParameterBag->resolveString('%java_path%', array()) in C:\wamp\www\oksa-depannage\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\ParameterBag\ParameterBag.php line 203
at ParameterBag->resolveValue('%java_path%', array()) in C:\wamp\www\oksa-depannage\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\ParameterBag\ParameterBag.php line 193
at ParameterBag->resolveValue(array('debug' => '%kernel.debug%', 'use_controller' => false, 'bundles' => array('OksaTemplateBundle'), 'java' => '%java_path%', 'filters' => array('cssrewrite' => null, 'yui_css' => array('jar' => '%kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar'), 'yui_js' => array('jar' => '%kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar'))), array()) in C:\wamp\www\oksa-depannage\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\ParameterBag\ParameterBag.php line 193
at ParameterBag->resolveValue(array(array('debug' => '%kernel.debug%', 'use_controller' => false, 'bundles' => array('OksaTemplateBundle'), 'java' => '%java_path%', 'filters' => array('cssrewrite' => null, 'yui_css' => array('jar' => '%kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar'), 'yui_js' => array('jar' => '%kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar'))), array('use_controller' => true))) in C:\wamp\www\oksa-depannage\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationPass.php line 44
at MergeExtensionConfigurationPass->process(object(ContainerBuilder)) in C:\wamp\www\oksa-depannage\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass.php line 39
at MergeExtensionConfigurationPass->process(object(ContainerBuilder)) in C:\wamp\www\oksa-depannage\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\Compiler\Compiler.php line 117
at Compiler->compile(object(ContainerBuilder)) in C:\wamp\www\oksa-depannage\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\ContainerBuilder.php line 619
at ContainerBuilder->compile() in C:\wamp\www\oksa-depannage\app\bootstrap.php.cache line 2491
at Kernel->initializeContainer() in C:\wamp\www\oksa-depannage\app\bootstrap.php.cache line 2270
at Kernel->boot() in C:\wamp\www\oksa-depannage\app\bootstrap.php.cache line 2301
at Kernel->handle(object(Request)) in C:\wamp\www\oksa-depannage\web\app_dev.php line 28
thanks for your helps.
Looks like symfony is trying to start the yui compressor, which is a java library.
This post has a workaround to make this situation work on windows: symfony2 assetics yui compressor on windows (path syntax)
I'm doing all of this locally for testing purposes right now. I ran the service project in visual studio and have my local version of the site setup to make the call to the web service but it won't hit it.
Here's the call:
$client = new SoapClient(null, array('location' => "https://localhost:51063/Service1.asmx", 'uri' => 'http://localhost:51063/'));
$client->newMeeting(array('id' => '10000', 'location' => 'test', 'committee' => 'test', 'desc' => 'test', 'date' => '2011-08-01', 'duration' => '180', 'agenda' => '', 'notes' => '', 'agenda' => '', 'notes' => ''));
And using that I get this error:
Uncaught SoapFault
Could not connect to host
Trace in execution order:
Dispatcher→dispatch(null, 'page') on line 98 in C:\xampp\htdocs\narca\admin\index.php
Dispatcher→executeAction('plugin', 'committees', array[1]) on line 162 in C:\xampp\htdocs\narca\frog\Framework.php
PluginController→execute('committees', array[1]) on line 247 in C:\xampp\htdocs\narca\frog\Framework.php
call_user_func_array(array[2], array[0]) on line 84 in C:\xampp\htdocs\narca\frog\app\controllers\PluginController.php
CommitteesController→addevent() on line unknown in unknown
SoapClient→newMeeting(array[8]) on line 429 in C:\xampp\htdocs\narca\frog\plugins\committees\CommitteesController.php
SoapClient→__call('newMeeting', array[1]) on line unknown in unknown
SoapClient→__doRequest('<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:...', 'https://localhost:51063/Service1.asmx', 'http://localhost:51063/#newMeeting', 1, 0) on line unknown in unknown
If I try to call it like this:
$client = new SoapClient("https://localhost:51063/Service1.asmx?WSDL");
I get a different error:
Uncaught SoapFault
SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://97.67.111.2:51063/Service1.asmx?WSDL' : failed to load external entity "http://97.67.111.2:51063/Service1.asmx?WSDL"
Trace in execution order:
Dispatcher→dispatch(null, 'page') on line 98 in /mnt/stor2-wc1-dfw1/410993/410996/lab.narca.org/web/content/admin/index.php
Dispatcher→executeAction('plugin', 'committees', array[1]) on line 162 in /mnt/stor2-wc1-dfw1/410993/410996/lab.narca.org/web/content/frog/Framework.php
PluginController→execute('committees', array[1]) on line 247 in /mnt/stor2-wc1-dfw1/410993/410996/lab.narca.org/web/content/frog/Framework.php
call_user_func_array(array[2], array[0]) on line 84 in /mnt/stor2-wc1-dfw1/410993/410996/lab.narca.org/web/content/frog/app/controllers/PluginController.php
CommitteesController→addevent() on line unknown in unknown
SoapClient→SoapClient('http://97.67.111.2:51063/Service1.asmx?WSDL') on line 423 in /mnt/stor2-wc1-dfw1/410993/410996/lab.narca.org/web/content/frog/plugins/committees/CommitteesController.php
Is this setup even possible? Or is there a way I can make the live site hit my local service?
Can you fetch that URL from the server PHP is on, using curl or something similar? Is there a firewall somewhere that blocks those high-numbered-post requests? Your PHP looks fine so I don't think you are doing anything wrong there.