This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » support » Installation and setup » How to configure enviroment on windows 7?
How to configure enviroment on windows 7? [message #103052] Sun, 25 July 2010 12:46 Go to next message
lobopl  is currently offline lobopl
Messages: 5
Registered: July 2010
Junior Member
Can someone direct me how to install and configure correctly apache/php for symfony?

Here is what I do:
-zend server installation
-chceck_configuration.php
-added php to PATH and restarted pc
php.ini used by PHP: C:\Zend\ZendServer\etc\php.ini


** Mandatory requirements **

  OK        PHP version is at least 5.2.4 (5.3.2)

** Optional checks **

  OK        PDO is installed
  OK        PDO has some drivers installed: sqlite, mysql, pgsql, sqlite2, oci
  OK        PHP-XML module is installed
  OK        XSL module is installed
  OK        The token_get_all() function is available
  OK        The mb_strlen() function is available
  OK        The iconv() function is available
  OK        The utf8_decode() is available
[[WARNING]] The posix_isatty() is available: FAILED
            *** Install and enable the php_posix extension (used to colorized the CLI output) ***
  OK        A PHP accelerator is installed
  OK        php.ini has short_open_tag set to off
  OK        php.ini has magic_quotes_gpc set to off
  OK        php.ini has register_globals set to off
  OK        php.ini has session.auto_start set to off
  OK        PHP version is not 5.2.9

-edited httpd.conf to enable vhost
-edited httpd-vhosts.conf added:
NameVirtualHost 127.0.0.1:80
<VirtualHost 127.0.0.1:80>
 ServerName localhost.tld
 DocumentRoot "C:\dev\dziennik\web"
 DirectoryIndex index.php
 <Directory "C:\dev\dziennik\web">
  AllowOverride All
  Allow from All
 </Directory>
 
 Alias /sf "C:\dev\dziennik\lib\vendor\symfony\data\web\sf"
 <Directory "C:\dev\dziennik\lib\vendor\symfony\data\web\sf">
  AllowOverride All
  Allow from All
 </Directory>

</VirtualHost>

-restart apache

-on c:\dev\dziennik\lib\vendor unrar http://www.symfony-project.org/get/symfony-1.4.6.zip and rename unpacked folder from symfony-1.4.6 to symfony

-opened cmd and cd to c:\dev\dziennik
-php lib\vendor\symfony\data\bin\symfony generate:project dziennik it created new folders etc. (no errors)

-in cmd php lib\vendor\symfony\data\bin\symfony -V
result
symfony version 1.4.6 (C:\dev\dziennik\lib\vendor\symfony\lib)


-checked config/ProjectConfiguration.class.php
result:
<?php

require_once dirname(__FILE__).'/..\lib\vendor\symfony\lib/autoload/sfCoreAutoload.class.php';
sfCoreAutoload::register();

class ProjectConfiguration extends sfProjectConfiguration
{
  public function setup()
  {
    $this->enablePlugins('sfDoctrinePlugin');
  }
}


-cmd-> php lib\vendor\symfony\data\bin\symfony generate:app frontend another files created (no error)

-cmd copy lib\vendor\symfony\data\bin\symfony.bat
-cmd symfony configure:database "mysql:host=localhost;dbname=dziennik" root pass

-cmd symfony generate:module frontend content (again more files no errors)

-added in C:\dev\dziennik\apps\frontend\modules\content\actions\action s.class.php new method
public function executeShow()
  {
  }

-added to C:\dev\dziennik\apps\frontend\modules\content\templates showSucces.php with:
<form method="post" action="<?php echo url_for('content/update') ?>">
  <label for="name">What is your name?</label>
  <input type="text" name="name" id="name" value="" />
  <input type="submit" value="Ok" />
  <?php echo link_to('I never say my name', 'content/update?name=anonymous') ?>
</form>


-added in C:\dev\dziennik\apps\frontend\modules\content\actions\action s.class.php new method
  public function executeUpdate($request)
  {
    $this->name = $request->getParameter('name');
  }

-added to C:\dev\dziennik\apps\frontend\modules\content\templates showUpdate.php with:
<p>Hello, <?php echo $sf_params->get('name', 'John Doe') ?>!</p>


-Tutorial ( http://www.symfony-project.org/gentle-introduction/1_4/en/04 -The-Basics-of-Page-Creation) Says that i should be equivalent to
<?php if ($sf_params->has('name')): ?>
  <p>Hello, <?php echo $sf_params->get('name') ?>!</p>
<?php else: ?>
  <p>Hello, John Doe!</p>
<?php endif; ?>

and when I go from http://localhost.tld/frontend_dev.php/content/show sending for example "asda" next page should be: "Hello, asda!" or if I left it blank it should be "Hello, John Doe!" but in both case I get:
Hello,
Warning: call_user_func() expects parameter 1 to be a valid callback, function 'John Doe' not found or invalid function name in C:\dev\dziennik\lib\vendor\symfony\lib\escaper\sfOutputEscaper.class.php on line 92
!

What I have done wrong?

1.4.6 symfony don't work that way? Is it that different from 1.4?
Re: How to configure enviroment on windows 7? [message #103328 is a reply to message #103052 ] Fri, 30 July 2010 22:58 Go to previous message
claudia_k  is currently offline claudia_k
Messages: 29
Registered: June 2010
Junior Member
The documentation seems to be wrong.

The problem seems to be that symfony wraps template variables in an sfOutputEscaperObjectDecorator for security reasons. This sfOutputEscaperObjectDecorator has already a method called 'get' for retrieving values but the second argument is a callback (the escaping method). Thus the error message.

$sf_params->getRawValue() would give you access to the raw $sf_params object, so in theory you could do
$sf_params->getRawValue()->get('name', 'John Doe');

But this would mean that the content of the parameter 'name' is not escaped which poses a security risk (see also bug [url http://trac.symfony-project.org/ticket/1775]ticket 1775[/url]).

Claudia


http://www.knewledge.com
Previous Topic:Problem on IIS 7
Next Topic:Setup on Plesk 9.3 server
Goto Forum:
  

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