程序问答   发布时间:2022-06-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了在运行`php app / console doctrine:schema:create`时对“没有这样的文件或目录”进行故障排除大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

如何解决在运行`php app / console doctrine:scheR_275_11845@a:create`时对“没有这样的文件或目录”进行故障排除?

开发过程中遇到在运行`php app / console doctrine:scheR_275_11845@a:create`时对“没有这样的文件或目录”进行故障排除的问题如何解决?下面主要结合日常开发的经验,给出你关于在运行`php app / console doctrine:scheR_275_11845@a:create`时对“没有这样的文件或目录”进行故障排除的解决方法建议,希望对你解决在运行`php app / console doctrine:scheR_275_11845@a:create`时对“没有这样的文件或目录”进行故障排除有所启发或帮助;

我通过遵循此小教程对其进行了修复:http ://andreys.info/blog/2007-11-07/configuring-terminal-to-work-with-mamp-mysql- on-Leopard

现在我得到以下错误:

[Exception]                                                                                            
 datetiR_275_11845@e::__construct(): it is not safe to rely on the system's timezone setTings.
 You are *required* to use the date.timezone setTing or the date_default_timezone_set() function.
 In case you used any of those methods and you are still getTing this warning, you most likely misspelled the timezone IDentifIEr.
 We SELEcted 'Europe/Berlin' for 'CEST/2.0/DST' instead

这是php.ini中的date.timezone配置

date.timezone = "Europe/Paris"

我会尝试自己解决这个问题,但是如果您知道如何解决它,请立即对此发表评论。谢谢!

解决方法

@H_450_21@

我是Symfony2(beta4)和Doctrine的新手,尝试通过命令行创建数据库模式时遇到问题

这是错误:

$ php app/console doctrine:scheR_275_11845@a:create

CreaTing database scheR_275_11845@a...

[PDOException]                                    
SQLSTATE[HY000] [2002] No such file or directory

[ErrorException]                                                                                          
Warning: PDO::__construct(): [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) 
in /Applications/MAMP/htdocs/sf-test-2/vendor/doctrine-dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php line 36
@H_506_2@mysql数据库设置已正确插入config / parameters.ini文件中。

这是config.yml中的Doctrine配置

# Doctrine Configuration
doctrine:
    dbal:
        driver:   %database_driver%
        host:     %database_host%
        dbname:   %database_name%
        user:     %database_user%
        password: %database_password%

    orm:
        auto_generate_proxy_classes: %kernel.debug%
        auto_mapping: true

和实体(我只做了一个测试)

<?php
// src/Acme/NewsBundle/Entity/Article.php
namespace Acme\NewsBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 * @ORM\Table(name="articles")
 */
class Article
{
    /**
     * @ORM\Id
     * @ORM\column(type="Integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
protected $id;

/**
 * @ORM\column(type="String",length="255")
 */
protected $title;

/**
 * @ORM\column(type="text")
 */
protected $body;

/**
 * @ORM\column(type="String",length="255")
 */
protected $author;

/**
 * @ORM\column(type="date")
 */
protected $date;
}
?>

大佬总结

以上是大佬教程为你收集整理的在运行`php app / console doctrine:schema:create`时对“没有这样的文件或目录”进行故障排除全部内容,希望文章能够帮你解决在运行`php app / console doctrine:schema:create`时对“没有这样的文件或目录”进行故障排除所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。