Pergunta

O que eu fiz:

  1. ) Swift-4.1.5.tar baixado
  2. ) Extraiu-o
  3. ) Carregado em meu host em / public_html / domain / lib usando FileZilla
  4. ) Fez um novo script usando o código abaixo.
  5. ) Abri no navegador e recebi o seguinte erro abaixo

Então, minha pergunta é: como recebo o erro de que o arquivo não existe se estiver 100% lá?Obrigado!

    <?php

      require_once '/public_html/domain/lib/swift_required.php';

    ?>

Aviso: require_once (/public_html/domain/lib/swift_required.php) [function.require-once]: falha ao abrir o fluxo: Não existe esse arquivo ou diretório em /home/myuser/public_html/domain/email.phplinha 5

Erro fatal: require_once () [function.require]: Falha ao abrir necessário '/public_html/domain/lib/swift_required.php' (include_path= '.: / usr / lib / php: / usr / local / lib /php ') em /home/myuser/public_html/domain/email.php na linha 5

Aqui está uma captura de tela do meu diretório do FileZilla. http://i.imgur.com/Zsy8y.jpg

Foi útil?

Solução

Isso está errado:

// this is absolute path, just like /home/user or /var/www
require_once '/public_html/domain/lib/swift_required.php'; 

Use em seu lugar:

// this is relative path to the current file
require_once 'public_html/domain/lib/swift_required.php'; //notice: no '/' in the beggining

OU:

// so use this one if you know the whole path to the file
require_once ABSOLUTE_PATH_TO . 'public_html/domain/lib/swift_required.php';

OU:

// or use this one if you don't know the whole path
// or if the path will change (dev machine and production machine)
require_once dirname(__FILE__) . RELATIVE_PATH_TO . 'public_html/domain/lib/swift_required.php';
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top