symfony
symfony forum
Home » symfony projects » askeet » 24-day example and problem with config_databases.yml.php
24-day example and problem with config_databases.yml.php [message #6732] Sat, 27 May 2006 14:12 Go to next message
sven  is currently offline sven
Messages: 8
Registered: May 2006
Junior Member
I have followed the guide until day 2, where I should be able to get the database ready and scaffold, too (the link http://askeet/question should output the title-body form).

At that point I get this error:
Parse error: syntax error, unexpected T_ARRAY, expecting T_STRING or T_VARIABLE or '$' in /home/projects/askeet/cache/frontend/dev/config/config_databases.yml.php on line 5


The contents of the file is this:
<?php
// auto-generated by sfDatabaseConfigHandler
// date: 2006/05/27 05:11:09

$database = new Array();
$database->initialize(null, 'propel');
$this->databases['propel'] = $database;
?>


I am quite clueless here Sad Here are the specs: Apache 2.0.55, PHP 5.1.2, as mod_php and Mysql 5.0.21
Re: 24-day example and problem with config_databases.yml.php [message #6733 is a reply to message #6732 ] Sat, 27 May 2006 14:27 Go to previous messageGo to next message
dzejkej  is currently offline dzejkej
Messages: 64
Registered: May 2006
Member
Hi!

I looked into my config_databases.yml and have there
$database = new sfPropelDatabase(); 


Try clearing cache with
symfony cc

in your project. And reload page.


It that doesn't help ...
Which version of symfony are you using?
Is your database.yml same as that one in tutorial?


dzejkej is closed-source SVK human product

lazy man for professional web tools
Re: 24-day example and problem with config_databases.yml.php [message #6736 is a reply to message #6732 ] Sat, 27 May 2006 14:50 Go to previous messageGo to next message
sven  is currently offline sven
Messages: 8
Registered: May 2006
Junior Member
Thanks for advice - now some new things came up:
- when I do "symfony cc", I got $database=new Array(); again and changed it manually to sfPropelDatabase();
- then I got some new errors:
Notice: Undefined variable: type in /usr/share/pear/symfony/addon/creole/drivers/sfDebugConnection.php on line 80

and the code at the lines 76-81:
  public function connect($dsninfo, $flags = 0)
  {
    if (!($driver = Creole::getDriver($dsninfo['phptype'])))
    {
      throw new SQLException("No driver has been registered to handle connection type: $type");
    }

and then just below, the Propel exception error message:
[wrapped: No driver has been registered to handle connection type: [User Info: Array]]

and the stack trace:
at ()
in SF_SYMFONY_LIB_DIR/vendor/propel/Propel.php line 484 ...
            try {
                $con = Creole::getConnection($dsn);
            } catch (SQLException $e) {
                throw new PropelException($e);
            }
            self::$connectionMap[$name] = $con;

I am using 0.7.1369 of Symfony and database.yml looks like this:
all:
 propel:
  class: sfPropelDatabase
   param:
    phptype: mysql
    host: localhost
    database: askeet
    username: root
    password: 1234r

[Updated on: Sat, 27 May 2006 15:14]

Re: 24-day example and problem with config_databases.yml.php [message #6737 is a reply to message #6736 ] Sat, 27 May 2006 15:08 Go to previous messageGo to next message
dzejkej  is currently offline dzejkej
Messages: 64
Registered: May 2006
Member
Add
datasource: symfony

in the params section of database.yml

(I was writing about no need to have dns and the other options, but during it you edited your post Thumbs Up Smile )


Hope it helps! Smile


dzejkej is closed-source SVK human product

lazy man for professional web tools
Re: 24-day example and problem with config_databases.yml.php [message #6738 is a reply to message #6732 ] Sat, 27 May 2006 15:26 Go to previous messageGo to next message
dzejkej  is currently offline dzejkej
Messages: 64
Registered: May 2006
Member
I finished 2nd day from askeet tutorial some minutes ago and its working for me - no datasource param needed Confused .

2 files are modified and your database.yml looks good. Whats in your propel.ini?


dzejkej is closed-source SVK human product

lazy man for professional web tools
Re: 24-day example and problem with config_databases.yml.php [message #6739 is a reply to message #6732 ] Sat, 27 May 2006 15:27 Go to previous messageGo to next message
sven  is currently offline sven
Messages: 8
Registered: May 2006
Junior Member
yeah, I am trying just every combination I can Laughing

Now I did this:
- added datasource: symfony to /home/projects/askeet/config/databases.yml
- did symfony cc
- then went to http://symfony/frontend_dev.php/question and had the first error ( unexpected T_ARRAY, expecting T_STRING or T_VARIABLE...)
- changed /home/projects/askeet/cache/frontend/dev/config/config_datab ases.yml.php to have sfPropelDatabase instead of Array
- but then again got errors just like before:
http://users.utu.fi/svkaub/propel.jpg
Re: 24-day example and problem with config_databases.yml.php [message #6740 is a reply to message #6732 ] Sat, 27 May 2006 15:28 Go to previous messageGo to next message
sven  is currently offline sven
Messages: 8
Registered: May 2006
Junior Member
Here is propel.ini:
propel.targetPackage       = model
propel.project             = askeet
propel.database            = mysql
propel.database.createUrl  = [url]mysql://localhost/[/url]
propel.database.url        = [url]mysql://root:1234r@localhost/askeet[/url]

propel.addGenericAccessors = true
propel.addGenericMutators  = true
propel.addTimeStamp        = false

propel.schema.validate     = false

; directories
propel.home                    = .
propel.output.dir              = /home/projects/askeet
propel.schema.dir              = ${propel.output.dir}/config
propel.conf.dir                = ${propel.output.dir}/config
propel.phpconf.dir             = ${propel.output.dir}/config
propel.sql.dir                 = ${propel.output.dir}/data/sql
propel.runtime.conf.file       = runtime-conf.xml
propel.php.dir                 = ${propel.output.dir}/lib
propel.default.schema.basename = schema
propel.datadump.mapper.from    = *schema.xml
propel.datadump.mapper.to      = *data.xml

; builder settings
propel.builder.peer.class              = symfony.addon.propel.builder.SfPeerBuilder
propel.builder.object.class            = symfony.addon.propel.builder.SfObjectBuilder

propel.builder.objectstub.class        = propel.engine.builder.om.php5.PHP5ExtensionObjectBuilder
propel.builder.peerstub.class          = propel.engine.builder.om.php5.PHP5ExtensionPeerBuilder
propel.builder.objectmultiextend.class = propel.engine.builder.om.php5.PHP5MultiExtendObjectBuilder
propel.builder.mapbuilder.class        = propel.engine.builder.om.php5.PHP5MapBuilderBuilder
propel.builder.interface.class         = propel.engine.builder.om.php5.PHP5InterfaceBuilder
propel.builder.node.class              = propel.engine.builder.om.php5.PHP5NodeBuilder
propel.builder.nodepeer.class          = propel.engine.builder.om.php5.PHP5NodePeerBuilder
propel.builder.nodestub.class          = propel.engine.builder.om.php5.PHP5ExtensionNodeBuilder
propel.builder.nodepeerstub.class      = propel.engine.builder.om.php5.PHP5ExtensionNodePeerBuilder

propel.schema.validate = false
propel.mysql.tableType = InnoDB

[Updated on: Sat, 27 May 2006 15:29]

Re: 24-day example and problem with config_databases.yml.php [message #6743 is a reply to message #6740 ] Sat, 27 May 2006 15:45 Go to previous messageGo to next message
dzejkej  is currently offline dzejkej
Messages: 64
Registered: May 2006
Member
Really strange Crying or Very Sad

I used your propel.ini and modifiend just output dir did all steps from that day once again a still is everything working Confused

Have two lame ideas:
  1. try to delete the project and do 2nd day again (maybe one little slip happened)
  2. try to reinstall symfony Smile


Any other ideas, people? Shocked


dzejkej is closed-source SVK human product

lazy man for professional web tools
Re: 24-day example and problem with config_databases.yml.php [message #6744 is a reply to message #6732 ] Sat, 27 May 2006 15:51 Go to previous messageGo to next message
sven  is currently offline sven
Messages: 8
Registered: May 2006
Junior Member
Thanks again for trying things. I'll try a clean install and follow the instructions as close to the letter as possible. Got to print them out to not to miss anything...
Re: 24-day example and problem with config_databases.yml.php [message #6745 is a reply to message #6744 ] Sat, 27 May 2006 15:58 Go to previous messageGo to next message
dzejkej  is currently offline dzejkej
Messages: 64
Registered: May 2006
Member
Sorry that I didn't help Embarassed Write here how it went then. I'm waiting Smile


dzejkej is closed-source SVK human product

lazy man for professional web tools
Re: 24-day example and problem with config_databases.yml.php [message #6747 is a reply to message #6732 ] Sat, 27 May 2006 17:00 Go to previous messageGo to next message
sven  is currently offline sven
Messages: 8
Registered: May 2006
Junior Member
Yeah! It works now Very Happy I have been using Linux Vserver for trying out new things and symfony, too. That somehow caused the problems. I tried now all the steps in the "real" server and it worked! Even the /home/sfprojects/askeet/cache/frontend/dev/config/config_dat abases.yml.php is OK.

[Updated on: Sat, 27 May 2006 17:03]

Re: 24-day example and problem with config_databases.yml.php [message #6751 is a reply to message #6747 ] Sat, 27 May 2006 17:37 Go to previous messageGo to next message
dzejkej  is currently offline dzejkej
Messages: 64
Registered: May 2006
Member
Yupiii Smile Nod

Next time I will not try to think and just recommend doing again from scratch Cool Smile


dzejkej is closed-source SVK human product

lazy man for professional web tools
Re: 24-day example and problem with config_databases.yml.php [message #6754 is a reply to message #6732 ] Sat, 27 May 2006 18:43 Go to previous messageGo to next message
sven  is currently offline sven
Messages: 8
Registered: May 2006
Junior Member
I got now the symfony even to work inside a vserver guest!

If anyone else runs into the same kind of problems - It was perhaps the php-cgi package from my lighttpd tests I had installed and forgot the old docroot info I had at php.ini. I removed php-cgi and updated php. Then I set doc_root = to be blank, just like in the "real" server before and performed all the steps from day 2. Also made another change: set <VirtualHost *:80> instead of <VirtualHost 10.0.190.200:80> at httpd.conf and set the Listen directive to "Listen 127.0.0.1:80".

[Updated on: Sat, 27 May 2006 18:44]

Re: 24-day example and problem with config_databases.yml.php [message #14316 is a reply to message #6754 ] Fri, 20 October 2006 20:52 Go to previous messageGo to next message
andjules  is currently offline andjules
Messages: 4
Registered: March 2006
Location: toronto
Junior Member
Just wanted to say, I was getting the same error (the later one: "Undefined variable: type in... creole/drivers/sfDebugConnection.php on line 80" followed by the propel exception "No driver has been registered..."

I have noticed others saying that databases.yml is finicky, and I only fixed it by playing extensively with tabs and spacing. it currently reads:

all:
propel:
class: sfPropelDatabase
param:
phptype: mysql
host: localhost
database: askeet
username: andjules
password: passxxxx

watch copying and pasting from the web page (day 2).
Re: 24-day example and problem with config_databases.yml.php [message #17472 is a reply to message #14316 ] Thu, 07 December 2006 20:52 Go to previous messageGo to next message
chadmanmn  is currently offline chadmanmn
Messages: 2
Registered: December 2006
Location: Minneapolis, USA
Junior Member
For the record in case others run into this:

I had this problem as well (PropelException), and tracked it down to databases.yml. In my case, I had both dsn: and host: specified. I removed host: and it instantly worked.
Re: 24-day example and problem with config_databases.yml.php [message #21105 is a reply to message #17472 ] Tue, 06 February 2007 15:01 Go to previous message
NiKo  is currently offline NiKo
Messages: 16
Registered: July 2006
Location: Arcueil, France
Junior Member
Check the reply I made here : http://www.symfony-project.com/forum/index.php/mv/msg/1629/1 3512/#msg_num_4
Previous Topic:XHMTL fixes
Next Topic:Day 21 SQL Exception
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software