---
title: "require_once in localconf.php"
url: "https://www.typo3.net/d/102981-require-once-in-localconfphp"
source: "typo3.net"
tags: ["Allgemein","Frage"]
created: "2010-12-20"
last_reply: "2011-01-12"
replies: 4
solved: false
page: 1
pages: 1
lang: "de"
---

# require_once in localconf.php

Allgemein · 4 Antworten · gestartet 2010-12-20

## Eröffnungsbeitrag

**leibnitz** · 2010-12-20 · [Beitrag #1](https://www.typo3.net/d/102981-require-once-in-localconfphp/1)

Hi,

ich möchte gerne eine PHP in die *localconf.php* hinzufügen, allerdings erhalte ich immer einen Fehler.

Ich habe im fileadmin ordner eine datei angelegt mit dem Namen **user_mobile.php**.

wenn ich diese mit

```php
require_once('fileadmin/template/mobile/user_mobile.php');
```

einfügen möchte erhalte ich im BE folgenden Fehler:

```php
Warning: require_once(fileadmin/template/mobile/user_mobile.php) [function.require-once]: failed to open stream: No such file or directory in /home/www/10488/domain.de/www/htdocs/cms/typo3conf/localconf.php on line 33

Fatal error: require_once() [function.require]: Failed opening required 'fileadmin/template/mobile/user_mobile.php' (include_path='.:/usr/local/php5-apache22/lib/php') in /home/www/10488/domain.de/www/htdocs/cms/typo3conf/localconf.php on line 33
```

kann mir jemand sagen was ich da falsch mache?

Gruß Leibnitz

## Antworten

### [#2](https://www.typo3.net/d/102981-require-once-in-localconfphp/2) · stefan s · 2010-12-20

fileadmin liegt nicht innerhalb von typo3conf.

```php
require_once('../fileadmin/template/mobile/user_mobile.php');
```

### [#3](https://www.typo3.net/d/102981-require-once-in-localconfphp/3) · leibnitz · 2010-12-20

o mann, danke.

eigentlich klar ...

gruß leibnitz

### [#4](https://www.typo3.net/d/102981-require-once-in-localconfphp/4) · leibnitz · 2010-12-20

jetzt beklomm ich im FE einen neuen Fehler:

```php
Warning: require_once() [function.require-once]: Unable to access ../fileadmin/template/mobile/user_mobile.php in /home/www/10488/domain.de/www/htdocs/cms/typo3conf/localconf.php on line 33

Warning: require_once(../fileadmin/template/mobile/user_mobile.php) [function.require-once]: failed to open stream: Permission denied in /home/www/10488/domain.de/www/htdocs/cms/typo3conf/localconf.php on line 33

Fatal error: require_once() [function.require]: Failed opening required '../fileadmin/template/mobile/user_mobile.php' (include_path='.:/usr/local/php5-apache22/lib/php') in /home/www/10488/domain.de/www/htdocs/cms/typo3conf/localconf.php on line 33
```

dazu vllt. ne idee?
am webserver sind die berechtigungen eigentlich alle richtig gesetzt :-(

### [#5](https://www.typo3.net/d/102981-require-once-in-localconfphp/5) · gabba · 2011-01-12

Hallo

versuch es mal mit

```php
require_once(PATH_site.'/fileadmin/template/mobile/user_mobile.php');
```

Gruss
gabba

---

Quelle: „require_once in localconf.php“, typo3.net, https://www.typo3.net/d/102981-require-once-in-localconfphp
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
