문제

I've installed the latest version of CakePHP on a Ubuntu 10.10 machine. I was able to run through a beginner tutorial just fine so I think my configuration is close to being correct. I can't get cake bake to completely work though. Below is my session. Things that look like anomolies are in bold. I think I must have one or more small errors in my configuration that are manifesting when running the bake shell. Thanks!

ubuntu@myserver.com:~$ cd /var/www/app
ubuntu@myserver.com:/var/www/app$ ../cake/console/cake bake -app /var/www/app
Failed loading /usr/lib/php5/20090626.so: /usr/lib/php5/20090626.so: cannot open shared object

file: No such file or directory

Welcome to CakePHP v1.3.2 Console

App : app
Path: /var/www/app

Interactive Bake Shell

[D]atabase Configuration
[M]odel
[V]iew
[C]ontroller
[P]roject
[F]ixture
[T]est case
[Q]uit
What would you like to Bake? (D/M/V/C/P/F/T/Q)

P
What is the full path for this app including the app directory name?
Example:/var/www/app/myapp
[/var/www/app/myapp] > /var/www/app
Bake Project
Skel Directory: /usr/share/php/cake/console/templates/skel
Will be copied to: /var/www/app

Look okay? (y/n/q)
[y] > y
Do you want verbose output? (y/n)
[n] > y

Created: app in /var/www/app

/usr/share/php/cake/console/templates/skel/app_controller.php copied to

/var/www/app/app_controller.php
/usr/share/php/cake/console/templates/skel/app_model.php copied to
/var/www/app/app_model.php
/usr/share/php/cake/console/templates/skel/index.php copied to /var/www/app/index.php
/usr/share/php/cake/console/templates/skel/.htaccess copied to /var/www/app/.htaccess
/usr/share/php/cake/console/templates/skel/app_helper.php copied to /var/www/app/app_helper.php

Creating file /var/www/app/views/pages/home.ctp
File /var/www/app/views/pages/home.ctp exists, overwrite? (y/n/q)
[n] > y
Wrote /var/www/app/views/pages/home.ctp
Welcome page created
Random hash key created for 'Security.salt'
Random seed created for 'Security.cipherSeed'
Unable to set CAKE_CORE_INCLUDE_PATH, you should change it in /var/www/app/webroot/index.php
Could not set permissions on /var/www/app//tmp
chmod -R 0777 /var/www/app//tmp

Interactive Bake Shell

[D]atabase Configuration
[M]odel
[V]iew
[C]ontroller
[P]roject
[F]ixture
[T]est case
[Q]uit

What would you like to Bake? (D/M/V/C/P/F/T/Q)

q
ubuntu@myserver.com:/var/www/app$

도움이 되었습니까?

해결책

Mark Murphy,

1.

Failed loading /usr/lib/php5/20090626.so: /usr/lib/php5/20090626.so: cannot open shared object

*.so files are shared libraries. I would try to tackle it be (re-) installing the PHP CLI.

2.

Could not set permissions on /var/www/app//tmp

How could the slash creep in twice? Such a folder should not exist.

Edit0: It is a bit strange, as CakePHP should work right out of the box, but maybe you really should take a look at the specified variable in app/webroot/index.php and see if you can change the CAKE_CORE_INCLUDE_PATH so that the superfluous slash vanishes.

Edit1: For general deployment there is nothing better than this afaik.

Edit2: cake bake help returns: -app Absolute/Relative path to your app folder.

Hence you should call either:

  1. cake bake app /var/www/<your_project_name>/ <---- note the trailing slash or
  2. when in /var/www/ call cake bake app <just_your_project_name>

Edit3: In a nutshell: You could download the CakePHP tar.gz and unzip it in your /var/www/, then rename the folder (having some weird cakePHP-1234... name) into the name of your application, e.g. missioncontrol. Then in your browser: http://localhost/missioncontrol , proceed as instructed. This is a very quick method to get going, but you can develop other methods according to your build process.

After you have developed your app and intend to deploy it on a host different than your local machine, use the link provided under edit1.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top