Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Error when I want to generate a package
  • When I enter the command "php oil g package <package_name>", It doesn't work. I have an error, message :

    Warning: require(\bootstrap.php): failed to open stream: No such file or directo
    ry in C:\UwAmp\oil on line 52

    Fatal error: require(): Failed opening required '\bootstrap.php' (include_path='
    .;C:\php\pear') in C:\UwAmp\oil on line 52

    Some informations :

    Windows PATH is correctly set to php.exe.
    My directory is like that 

    C:\UwAmp>dir /B
    backup
    bin
    composer.json
    composer.phar
    oil
    phpapps
    phpstorm
    temp
    utils
    UwAmp License.txt
    UwAmp README.txt
    UwAmp.exe
    uwamp.ini
    UwAmpUAC.exe
    www

    C:\UwAmp\phpapps\fuel>dir /B
    .htaccess
    .idea
    app
    core
    LICENSE
    packages
    vendor
  • line 52 does:

    require APPPATH.'bootstrap.php';

    The error says "require(\bootstrap.php)", which would indicate the APPPATH contant contains "\", which is absolutely wrong.

    It is set on line 35 of the same "oil" file, and I assume your fuel/app folder is either not in the default location (which means you have to adjust the paths), or __DIR__ doesn't work (which indicates you're not using PHP 5.3.3+).
  • p.s. this also indicates you're using Fuel v1.7.x, and I'm not sure it has (full) package generation support. I think that was added quite recently.
  • I'm using php 5.4.15. Is it a problem ?
  • Nope, should work fine.

    So you have to figure out why the APPPATH constant in your oil script is empty (or points to the root).

    Afaik it should work fine on Windows.
  • Oh I understand why It didn't work. The Oil script is configured to work by default at the same directory level of Fuel package. We can see it by the constant statement 
    define('APPPATH', realpath(__DIR__.'/fuel/app/').DIRECTORY_SEPARATOR);

    I moved my Fuel package in a phpapps package and the Oil script was no more at the same level of Fuel package. It is normal I got an error. I moved Oil into phpapps package. Now It should be fine. 

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion