![Apache 和 PHP 错误消息](https://linux22.com/image/1133493/Apache%20%E5%92%8C%20PHP%20%E9%94%99%E8%AF%AF%E6%B6%88%E6%81%AF.png)
我正在从事个人项目并不断收到此错误消息:
Warning: require(/var/www/html/owncloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift.php): failed to open stream: No such file or directory in /var/www/html/owncloud/3rdparty/swiftmailer/swiftmailer/lib/swift_required.php on line 20
Fatal error: require(): Failed opening required '/var/www/html/owncloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift.php' (include_path='/var/www/html/owncloud/3rdparty/phpseclib/phpseclib/phpseclib:/var/www/html/owncloud/3rdparty/pear/console_getopt:/var/www/html/owncloud/3rdparty/pear/archive_tar:/var/www/html/owncloud/3rdparty/pear/pear_exception:/var/www/html/owncloud/3rdparty/pear/pear-core-minimal/src:/var/www/html/owncloud/lib/private:/var/www/html/owncloud/config:/var/www/html/owncloud/3rdparty:/var/www/html/owncloud/apps:/var/www/html/owncloud/lib:.:/usr/share/php:/usr/share/pear:/var/www/html/owncloud') in /var/www/html/owncloud/3rdparty/swiftmailer/swiftmailer/lib/swift_required.php on line 20
我该如何解决这个错误?我正在运行 Ubuntu Server 14.04 和 apache2
答案1
我会检查两件事
- 第一个文件不存在吗?
输出是什么
ls -ltrh /var/www/html/owncloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift.php
如果文件存在则执行步骤 2
文件的权限是什么
/var/www/html/owncloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift.php
它是否具有读取权限?如果没有,请执行 chmod 755
chmod 755 /var/www/html/owncloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift.php
如果文件不存在,我希望您知道需要做什么。