Hi,
I've got a problems hmm.. in fact, I do not know where :)
Ok, on my machine everything works perfectly fine. Problems arise when
I try to use PostgreSQL and memcached on test server. I do not have
access to server configuration, so hard for me at this moment to tell
anything about that - I'll ask the administrators if you need any
information.
I know that it will resemble a crystal ball predicting :)
Memcache problem
PHP Fatal error: Uncaught exception 'Doctrine_Cache_Exception' with
message 'In order to use Memcache driver, the memcache extension must
be loaded.' in
/home/imsoft/e-most/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Cache/Memcache.php:49
Stack trace:
#0 /home/imsoft/e-most/config/ProjectConfiguration.class.php(33):
Doctrine_Cache_Memcache->__construct(Array)
#1
/home/imsoft/e-most/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/config/sfDoctrinePluginConfiguration.class.php(58):
ProjectConfiguration->configureDoctrine(Object(Doctrine_Manager))
#2
/home/imsoft/e-most/lib/vendor/symfony/lib/config/sfPluginConfiguration.class.php(47):
sfDoctrinePluginConfiguration->initialize()
#3
/home/imsoft/e-most/lib/vendor/symfony/lib/config/sfProjectConfiguration.class.php(91):
sfPluginConfiguration->__construct(Object(ProjectConfiguration),
'/home/imsoft/e-...', 'sfDoctrinePlugi...')
#4
/home/imsoft/e-most/lib/vendor/symfony/lib/config/sfProjectConfiguration.class.php(62):
sfProjectConfiguration->loadPlug in
/home/imsoft/e-most/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Cache/Memcache.php
on line 49
Fatal error: Uncaught exception 'Doctrine_Cache_Exception' with
message 'In order to use Memcache driver, the memcache extension must
be loaded.' in
/home/imsoft/e-most/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Cache/Memcache.php:49
Stack trace:
#0 /home/imsoft/e-most/config/ProjectConfiguration.class.php(33):
Doctrine_Cache_Memcache->__construct(Array)
#1
/home/imsoft/e-most/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/config/sfDoctrinePluginConfiguration.class.php(58):
ProjectConfiguration->configureDoctrine(Object(Doctrine_Manager))
#2
/home/imsoft/e-most/lib/vendor/symfony/lib/config/sfPluginConfiguration.class.php(47):
sfDoctrinePluginConfiguration->initialize()
#3
/home/imsoft/e-most/lib/vendor/symfony/lib/config/sfProjectConfiguration.class.php(91):
sfPluginConfiguration->__construct(Object(ProjectConfiguration),
'/home/imsoft/e-...', 'sfDoctrinePlugi...')
#4
/home/imsoft/e-most/lib/vendor/symfony/lib/config/sfProjectConfiguration.class.php(62):
sfProjectConfiguration->loadPlug in
/home/imsoft/e-most/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Cache/Memcache.php
on line 49
When I disable memcache in
config/ProjectConfiguration.class.php:configureDoctrine()
public function configureDoctrine(Doctrine_Manager $manager)
{
$servers = array(
'host' => 'localhost',
'port' => 11213,
'persistent' => true
);
$cacheDriver = new Doctrine_Cache_Memcache(array(
'servers' => $servers,
'compression' => false
));
$manager->setAttribute(Doctrine::ATTR_RESULT_CACHE, $cacheDriver);
}
I see this error:
You must have memcache installed and enabled to use sfMemcacheCache class.
factories
view_cache:
class: sfMemcacheCache
param:
lifetime: 86400
prefix: emost
servers:
localhost:
host: localhost
post: 11213
BTW. I use this patch temporarily
diff --git a/lib/vendor/symfony/lib/cache/sfMemcacheCache.class.php
b/lib/vendor/symfony/lib/cache/sfMemcacheCache.class.php
index 734206d..8f2dffd 100644
--- a/lib/vendor/symfony/lib/cache/sfMemcacheCache.class.php
+++ b/lib/vendor/symfony/lib/cache/sfMemcacheCache.class.php
@@ -59,7 +59,7 @@ class sfMemcacheCache extends sfCache
{
foreach ($this->getOption('servers') as $server)
{
- $port = isset($server['port']) ? $server['port'] : 11211;
+ $port = isset($server['port']) ? $server['port'] : 11213;
if (!$this->memcache->addServer($server['host'], $port,
isset($server['persistent']) ? $server['persistent'] : true))
{
throw new sfInitializationException(sprintf('Unable to
add this memcache server (%s:%s).', $server['host'], $port));
AFAICT both php-pecl-memcache and php-pecl-memcached are installed.
Simple memcache test script connects to memcache server
<?php
$memcache = new Memcache;
$memcache->connect('localhost', 11213) or die ("Could not connect");
$version = $memcache->getVersion();
echo "Server's version: ".$version."<br/>\n";
$tmp_object = new stdClass;
$tmp_object->str_attr = 'test';
$tmp_object->int_attr = 123;
$memcache->set('key', $tmp_object, false, 10) or die ("Failed to save
data at the server");
echo "Store data in the cache (data will expire in 10 seconds)<br/>\n";
$get_result = $memcache->get('key');
echo "Data from the cache:<br/>\n";
var_dump($get_result);
?>
so memcache is configured.
Does anyone have any idea why Doctrine can not connect to Memcache server?
Second problem - Postgres
>> doctrine PDO Connection Error: SQLSTATE[08006] [7] FATAL: no pg_hba.conf
>> entry for host "127.0.0.1", user "imsoft_imsoft", database "postgres"
all:
doctrine:
class: sfDoctrineDatabase
param:
dsn: pgsql:host=localhost;dbname=imsoft_imsoft
username: imsoft_imsoft
password: xxxxxx
Don't know why, but tries to connect to the database with a bad name
"postgres" instead of "imsoft_imsoft"
Simple test script connects fine
<?php
try {
$connection = new
PDO("pgsql:dbname=imsoft_imsoft;port=5432;host=localhost",
"imsoft_imsoft", "xyz" );
} catch(PDOException $e) {
echo $e->getMessage();
}
?>
And again - on my system everything works perfectly fine.
I know that there is something wrong with the test server
configuration. I would be very grateful if anyone would be able to
identify what is wrong with test server configuration.
--
Best regards,
Michal
http://eventhorizon.pl/
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en