【问题标题】:symfony 1.4.8+ doctrine --> doctrine:build-schema fatal error opening required /tmp/tmp_doctrine/User.phpsymfony 1.4.8+ 学说 --> 学说:需要打开构建模式致命错误 /tmp/tmp_doctrine/User.php
【发布时间】:2010-10-16 16:15:34
【问题描述】:

我正在试用 symfony,所以我开始通过 ssh 将它安装在远程机器上(普通用户,没有 root 访问权限)

当到达我想通过发出以下命令从现有 mysql 数据库中生成 db-schema 的部分时:

./symfony doctrine:build-schema

我收到以下错误:

Warning: require_once(): '/tmp/tmp_doctrine_models/User.php' is not a valid path for inclusions, since it includes /tmp/ in /home/users/mpretftp/test1/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Core.php on line 668

Warning: require_once(/tmp/tmp_doctrine_models/User.php): failed to open stream: Success in /home/users/mpretftp/test1/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Core.php on line 668

Fatal error: require_once(): Failed opening required '/tmp/tmp_doctrine_models/User.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/users/mpretftp/test1/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Core.php on line 668

通过“反其道而行之”,像这样创建 database.yaml:

User:
  actAs: { Timestampable: ~  }
  columns:
    id: { type: integer, notnull: true }
    hash: { type: string(255), notnull: true }

然后尝试 ./symfony 学说:build --model 我得到以下,甚至更奇怪的错误:

 ./symfony doctrine:build --model
>> doctrine  generating model classes
>> file+     /tmp/doctrine_schema_70737.yml


  Invalid schema element named "0" at path "Warning"

此外,主机(远程 mashine)对 joomla 错误消息有评论。一方面,我意识到 joomla 与 symfony 或教义无关。但是错误消息类似于我上面粘贴的第一个警告:“...不是包含的有效路径,因为它在...中包含'/tmp/'”。 joomla 错误的建议解决方案是在 joomla 配置中将 /tmp/ 路径更改为 /home/users/user/tmp

我最好的猜测是我需要说服教义也使用另一条路径。不幸的是,我找不到这样的教义配置选项。

谁能告诉我如何为学说/symfony 或 php 甚至环境设置 tmp 路径?或者在哪里继续“调试”?

【问题讨论】:

    标签: symfony1 doctrine


    【解决方案1】:

    Doctrine 使用 PHP 的 sys_get_temp_dir 来确定临时路径。我通过在 Doctrine 源代码中搜索 'tmp_doctrine_models' 发现了这一点。

    您的主机不允许写入临时目录,这似乎有点奇怪。

    【讨论】:

    • 好吧,它确实允许将 tempdir 写入到 tho,我尝试手动创建一个软链接“tmp_doctrine_models”到我家中的完全访问目录。但问题依然存在,似乎写入没有问题,但之后包括那些文件有问题
    猜你喜欢
    • 2011-05-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-04-09
    • 1970-01-01
    • 2012-06-11
    • 1970-01-01
    相关资源
    最近更新 更多