Jump to content


Photo

Installation on Ubuntu 10.04 LTS

php version

  • Please log in to reply
11 replies to this topic

#1 triplei

triplei

    Newbie

  • New Members
  • Pip
  • 3 posts
  • LocationAbbotsford BC, Canada

Posted 16 November 2012 - 02:01 AM

Hi there,

I just downloaded an installed Zurmo (0.7.8) locally on my Ubuntu 12.10 install. I did have to change a few php config settings (namely the date/timezone) as well as a few settings in my.cnf. T

After the install I liked what I saw so I was going to set up a production version. However our VPS's are all running Ubuntu 10.04 LTS which currently has php 5.3.2 while Zurmo appears to require 5.3.3. I did try changing the base requirement, but ran into an error message and haven't had time to track it down.

The message I am receiving is:

assert(): Assertion "property_exists($this, 'modelClassNameToBean') || $this->isAttribute('modelClassNameToBean')" failed
 
 
/home/crm/public_html/app/protected/core/models/RedBeanModel.php(1172)

I'm not sure if this is related to the php 5.3.2 version, or another server environment issue.

Thanks for everyone's work on this project. Let me know if there are any other details I can provide which would help me track down the issue.

#2 Ivica

Ivica

    Advanced Member

  • Moderators
  • 565 posts

Posted 16 November 2012 - 08:36 AM

I think I know what can be issue, can you try to execute this code on your server(php filename.php), and reply here with output:
<?php

class ExampleSuperClass
{
    private $foo;
    static protected $bar;

    private function foo()
    {
    }

    public function propertyFooExists()
    {
	    return property_exists($this, 'foo');
    }

}

class ExampleSubClass extends ExampleSuperClass
{
    public function methodExists()
    {
	    return method_exists($this, 'foo');
    }

    public function propertyBarExists()
    {
	    return property_exists($this, 'bar');
    }
}

$example = new ExampleSubClass();
var_dump($example->methodExists());
var_dump($example->propertyFooExists());
var_dump($example->propertyBarExists());
?>


#3 wwwalker

wwwalker

    Newbie

  • New Members
  • Pip
  • 5 posts
  • LocationOrange NSW Australia

Posted 16 November 2012 - 11:00 AM

I have tried to install Zurmo on Ubuntu 10.04.

I had trouble with php extensions. See below how I got round this.

I installed mercurial but did not clone site.

I ignored Selenium. It is a browser plugin. I have no browser on server
except lynx. I have firefox on my Linux netbook.

I just used zurmo tarball:

tar xvfz zurmo*

I am running ssh to a Unbuntu server (CLI) not a Ubuntu desktop so only
have lynx browser on the server and view site through firewall on my
netbook using Firefox. Some of your jargon is for someone with all on one
PC. I have a server and a netbook.

I had trouble with writable folder app/protected/runtime by yii.

/var/www/zurmo/yii/framework/base/CApplication.php (271)

I have set chown www-data:www-data for runtime folder and chmod 777
runtime folder and still I get yii writable error. I don't a server
writing via apache to folder - security hole.

CException

Application runtime path "/var/www/zurmo/app/protected/runtime" is not
valid. Please make sure it is a directory writable by the Web server
process.

/var/www/zurmo/yii/framework/base/CApplication.php(271)

259 return $this->_runtimePath;
260 }
261 }
262
263 /**
264 * Sets the directory that stores runtime files.
265 * @param string $path the directory that stores runtime files.
266 * @throws CException if the directory does not exist or is not
writable
267 */
268 public function setRuntimePath($path)
269 {
270 if(($runtimePath=realpath($path))===false ||
!is_dir($runtimePath) || !is_writable($runtimePath))
271 throw new CException(Yii::t('yii','Application runtime
path "{path}" is not valid. Please make sure it is a directory writable by
the Web server process.',
272 array('{path}'=>$path)));
273 $this->_runtimePath=$runtimePath;
274 }
275
276 /**
277 * Returns the root directory that holds all third-party extensions.
278 * @return string the directory that contains all extensions.
Defaults to the 'extensions' directory under 'protected'.
279 */
280 public function getExtensionPath()
281 {
282 return Yii::getPathOfAlias('ext');
283 }

Stack Trace
#0
+
/var/www/zurmo/yii/framework/base/CApplication.php(258):
CApplication->setRuntimePath("/var/www/zurmo/app/protected/runtime")
#1
+
/var/www/zurmo/yii/framework/logging/CFileLogRoute.php(60):
CApplication->getRuntimePath()
#2
+
/var/www/zurmo/yii/framework/logging/CLogRouter.php(67):
CFileLogRoute->init()
#3
+
/var/www/zurmo/yii/framework/base/CModule.php(388): CLogRouter->init()
#4
+
/var/www/zurmo/yii/framework/base/CModule.php(493):
CModule->getComponent("log")
#5
+
/var/www/zurmo/yii/framework/base/CApplication.php(146):
CModule->preloadComponents()
#6
+
/var/www/zurmo/yii/framework/YiiBase.php(127):
CApplication->__construct("/var/www/zurmo/app/protected/config/main.php")
#7

/var/www/zurmo/app/index.php(51):
YiiBase::createApplication("WebApplication",
"/var/www/zurmo/app/protected/config/main.php")

46
47 require_once($debug);
48 require_once($yii);
49 require_once($webApplication);
50
51 $webApplication = Yii::createApplication('WebApplication', $config);
52 if (file_exists($runtimePath))
53 {
54 $webApplication->setRuntimePath($runtimePath);
55 }
56 $webApplication->run();

2012-11-16 21:36:46 Apache/2.2.14 (Ubuntu) Yii Framework/1.1.12

I did not reinstall redbean or yii as they came with zurmo.

I installed:

apt-get install php5-dev

tried to install the following using pecl but failed mostly

pecl install curl - fail
pecl install mysql - fail
pecl install memcache - ok
pecl install apc - fail - make error 1

/etc/php5/apache2/php.ini
extension=memcache.so

the following worked

apt-get install php-apc
apt-get install php-soap
apt-get install php5-memcache
apt-get install php5-curl
apt-get install php5-imap
apt-get install memcached

I edited my.cnf with your settings.

I setup database zurmo and user zurmo, database zurmo_wacky and user
zurmoroot using phpmyadmin and commandline mysql.

I am going to try and put this bug in your forum.

Because of yii error I could not run the test. When I tried I got 403
forbidden.

cd zurmo
chown -R wwwalker:wwwalker *

You had 504:503 user:group. Why?

Dwight Walker
WWWalker Web Development Pty Ltd
www.wwwalker.com.au
Dwight Walker
WWWalker Web Development Pty Ltd
www.wwwalker.com.au

#4 Ivica

Ivica

    Advanced Member

  • Moderators
  • 565 posts

Posted 16 November 2012 - 01:22 PM

I would like to know how you solved first issue you had with installation, about property_exist error.

Runtime folder must be write-able by web process(Apache), this requirements comes from Yii framework, not from our application, we just checking if web server can write to this folder or not, and in your case seems that for some reason it is not.

About php extensions, you need to install pdo and pdo_mysql extensions too(maybe pdo is included in php_dev, but pdo_mysql is not I think, so please check that too).

#5 triplei

triplei

    Newbie

  • New Members
  • Pip
  • 3 posts
  • LocationAbbotsford BC, Canada

Posted 16 November 2012 - 07:35 PM

I think I know what can be issue, can you try to execute this code on your server(php filename.php), and reply here with output:

<?php
 
class ExampleSuperClass
{
	private $foo;
	static protected $bar;
 
	private function foo()
	{
	}
 
	public function propertyFooExists()
	{
		return property_exists($this, 'foo');
	}
 
}
 
class ExampleSubClass extends ExampleSuperClass
{
	public function methodExists()
	{
		return method_exists($this, 'foo');
	}
 
	public function propertyBarExists()
	{
		return property_exists($this, 'bar');
	}
}
 
$example = new ExampleSubClass();
var_dump($example->methodExists());
var_dump($example->propertyFooExists());
var_dump($example->propertyBarExists());
?>


Hi Ivica,

The output from running that code is:


bool(true)
bool(false)
bool(true)


Thanks for helping look into this

Dan

#6 wwwalker

wwwalker

    Newbie

  • New Members
  • Pip
  • 5 posts
  • LocationOrange NSW Australia

Posted 16 November 2012 - 11:47 PM

I installed extensions using apt-get install php-<extension> not pecl install <extension>.

I might rip out Yii.
Dwight Walker
WWWalker Web Development Pty Ltd
www.wwwalker.com.au

#7 wwwalker

wwwalker

    Newbie

  • New Members
  • Pip
  • 5 posts
  • LocationOrange NSW Australia

Posted 17 November 2012 - 07:35 AM

I got past 3 not writable errors:

chown www-data /var/www/zurmo/app/assets
chown www-data /var/www/zurmo/app/protected/data
chown www-data /var/www/zurmo/app/protected/runtime

I wrote a little script to test the writability of a directory instead of wading through all that Yii code:

<?
if (is_writable('/var/www/zurmo/app/protected/runtime')) {
print "writable";
} else {
print "not writable";
}
print "/var/www/zurmo/app/protected/runtime";
?>

I then tried:
chmod 775 <directory>
still unwritable

I then tried:
chown www-data <directory>
and directory was writable

I then tried:
chmod 755 <directory>
and directory was still writable

chown www-data was what got rid of error message not chmod 775. chmod 755 is safer anyway.

I also held shift down and clicked reload on browser to flush any old error messages. Sometimes page was still showing old error so I forced a reload using Shift-Reload on browser to make sure I was getting right error message.

The zurmo home page now loads:

.../zurmo/app/index.php/install/default

I got another writable error so:

chown www-data /var/www/zurmo/app/protected/config
Dwight Walker
WWWalker Web Development Pty Ltd
www.wwwalker.com.au

#8 wwwalker

wwwalker

    Newbie

  • New Members
  • Pip
  • 5 posts
  • LocationOrange NSW Australia

Posted 17 November 2012 - 07:53 AM

Zurmo test page:

Failed Required Services
PHP version installed: 5.3.2-1ubuntu4.18 FAIL
Minimum version required: 5.3.3


Failed Optional Services
PHP upload_max_filesize value is: 6M minimum requirement is: 20M FAIL
PHP post_max_size setting is: 8M minimum requirement is: 20M FAIL

I edited /etc/php5/apache2/php.ini for the last 2 errors and restarted apache2

/etc/init.d/apache2 restart

I clicked Recheck System twice using zurmo and still got the last 2 errors.

I ran phpinfo() in my own script and found php.ini was updated correctly but zurmo is not finding this and reporting errors in php.ini which are not there any more! May be repost is not working on Recheck System.

I hit reload on zurmo test page and last 2 errors went away.

This may be browser problem of caching. I am using Firefox 16 on Linux.

Thanks to:

http://www.zalexblog...n-ubuntu-10-04/

and

https://help.ubuntu....ies/CommandLine

I upgraded to PHP 5.3.6:

apt-get install python-software-properties
add-apt-repository ppa:bjori/php5
apt-get update
apt-get install php5 php5-cli

zurmo recheck system passed all now.

Now I can't login to mysql in phpmyadmin or my internal system. The php upgrade must have changed settings in php.ini.

In /etc/mysql/my.cnf
socket /var/run/mysqld/mysqld.sock

In /etc/php5/apache2/php.ini
mysql.default_socket = /var/run/mysqld/mysqld.sock
etc

/etc/init.d/apache2 restart

MySQL connection now works.

After setup of username etc, I got these errors because listed twice with different values in my.cnf so commented out duplicates and restarted mysql:

Failed Required Services
Database max_sp_recursion_depth size is: 0 minimum requirement is: 20 FAIL
Database thread_stack value is: 262144 minimum requirement is: 524288 FAIL
Database optimizer_search_depth value is 62. It is required to be set to 0. FAIL


Failed Optional Services
Database max_allowed_packet size is: 1M minimum requirement is: 20M

Even after fixing the errors in my.cnf and restarting mysql twice I still get the above errors even with Shift-Reload and Back and resubmit and 'recheck system'.

Following is place where the above error showed:
.../zurmo/app/index.php/install/default/settings


I moved the configs above into [mysqld] part of my.cnf and restarted mysql.

I get these errors now:

Failed Required Services
Database log_bin=on. Either set log_bin=off or set log_bin_trust_function_creators=on. FAIL
Database optimizer_search_depth value is 62. It is required to be set to 0. FAIL


Failed Optional Services
Database max_allowed_packet size is: 1M minimum requirement is: 20M

I fixed these
[mysqld]
log_bin_trust_function_creators=on
optimizer_search_depth=0
max_allowed_packet=20M

I restarted and rechecked system and passed and installed data! Data installed OK now.

Now I cannot login with zurmo and my password I setup. There is no forgot password feature.

login page that is failing:

.../zurmo/app/index.php/zurmo/default/login

I tried super and its password and logged in OK and set timezone.

I'm in!
Dwight Walker
WWWalker Web Development Pty Ltd
www.wwwalker.com.au

#9 Ivica

Ivica

    Advanced Member

  • Moderators
  • 565 posts

Posted 18 November 2012 - 08:24 AM

Dwight, which PHP version are you using? 5.3.2 or you upgraded it to more recent one?

#10 wwwalker

wwwalker

    Newbie

  • New Members
  • Pip
  • 5 posts
  • LocationOrange NSW Australia

Posted 18 November 2012 - 09:25 AM

PHP 5.3.6 using upgrade from private repository. Ubuntu only had PHP 5.3.2 from its repo.

I pulled down my Ubuntu server today as I cannot afford to run it any more. I hope someone gets value out all the pain above in setting up Zurmo on Ubuntu. Now it is going into cottonwool (backup).
Dwight Walker
WWWalker Web Development Pty Ltd
www.wwwalker.com.au

#11 triplei

triplei

    Newbie

  • New Members
  • Pip
  • 3 posts
  • LocationAbbotsford BC, Canada

Posted 19 November 2012 - 05:19 AM

Dwight, which PHP version are you using? 5.3.2 or you upgraded it to more recent one?


Ivica, did you have any thoughts with the output I posted from your previous test code? Is there any other info I can provide or other tests I can run which would help out? Or is 5.3.2 looking like it won't fit the criteria?

Thanks again,

Dan

#12 Ivica

Ivica

    Advanced Member

  • Moderators
  • 565 posts

Posted 19 November 2012 - 06:31 AM

Ivica, did you have any thoughts with the output I posted from your previous test code? Is there any other info I can provide or other tests I can run which would help out? Or is 5.3.2 looking like it won't fit the criteria?

Thanks again,

Dan

Running unit tests to ensure that everything is working fine is always good idea.

There was bug in php, which was fixed in 5.3.2 or 5.3.3, so if you are using php < 5.3.3 you should try to run unit tests, to ensure that everything is working fine:

http://bugs.php.net/50810








Also tagged with one or more of these keywords: php version

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users