Wenn ich mein YII-Projekt auf dem Server ausführen, habe ich diesen Fehler erhalten.CAsetManager.basePath "/ Assets" ist ungültig. Stellen Sie bitte sicher, dass das Verzeichnis existiert und vom Webserverprozess beschreibbar ist.
CException
CAssetManager.basePath "/var/www/html/v2/assets" is invalid. Please make sure the directory exists and is writable by the Web server process.
/var/www/html/v2/yii/framework/web/CAssetManager.php(116)
104 }
105
106 /**
107 * Sets the root directory storing published asset files.
108 * @param string $value the root directory storing published asset files
109 * @throws CException if the base path is invalid
110 */
111 public function setBasePath($value)
112 {
113 if(($basePath=realpath($value))!==false && is_dir($basePath) && is_writable($basePath))
114 $this->_basePath=$basePath;
115 else
116 throw new CException(Yii::t('yii','CAssetManager.basePath "{path}" is invalid. Please make sure the directory exists and is writable by the Web server process.',
117 array('{path}'=>$value)));
118 }
119
120 /**
121 * @return string the base url that the published asset files can be accessed.
122 * Note, the ending slashes are stripped off. Defaults to '/AppBaseUrl/assets'.
123 */
124 public function getBaseUrl()
125 {
126 if($this->_baseUrl===null)
127 {
128 $request=Yii::app()->getRequest();
Ich weiß nicht, wie man es löst? Bitte erklären Lösung davon?
Das ist meine Projektstruktur
assets
protected <-- Yii app
js
css
yii
übereinstimmen Wenn '/ var/www/html/v2/assets' existiert, dann ist es "/ var/www/html/v2/assets" ist nicht das Verzeichnis "Assets" Ihres Projekts, dann ist Ihre Anwendung nicht richtig konfiguriert. – Ezze
Was soll ich jetzt tun? – unknownbits
Wenn das Verzeichnis existiert, sollten Sie schreiben Berechtigungen für den Webserver Prozess wie Manquer schrieb Auch das 'protected/runtime' Verzeichnis muss erstellt und beschreibbar sein – Ezze