require_once(Console/getopt.php) : failed to open stream


(Tomlinson) #1

Hi folks


I'm installing Matrix v3.23 and have got a bit stuck. I can't see an obvious solution and any help would be much appreciated.



I'm installing via the command line and have got to the first run of compile_locale.php when the following error occurs:



Warning: require_once(Console/Getopt.php) : failed to open stream: No such file or directory in /var/www/vhosts/mysource_matrix/install/compile_locale.php on line 57



Fatal error: require_once(): failed opening required 'Console/Getopt.php' (include_path='.:/usr/share/php')

in /var/www/vhosts/mysource_matrix/install/compile_locale.php on line 57



My guess is that this relates to PEAR and that the PHP include paths. As you can see, I've set the path in php.ini to include the folder with Console/Getopt.php in it, but to no effect.



Could anyone explain what is happening and why, and any steps that I can take to debug this? I'm sorry if it's a dumb question, I haven't done any command line Linux for a long time and it is starting to mess with my head!



Thanks



Matt


(Nic Hubbard) #2

Check your php info to make sure that your include path is really set to where you think it is.

    php -i

(Anthony Barnes) #3

You might be able to check the pear config itself, check to see if that is where your packages were installed:

    
    pear config-show | grep "PEAR directory"

(Tomlinson) #4

[quote]
You might be able to check the pear config itself, check to see if that is where your packages were installed:


    
    pear config-show | grep "PEAR directory"

[/quote]



Thanks folks, much appreciated.



I've checked that. The PEAR directory is /usr/share/php - so I've added /usr/share/php/PEAR to the include path. Still the same result, could it be something simple like a permissions issue? Any guidance would be greatly appreciated.



I'll do a little more reading on include paths and see if I can get a separate test script to work.



Kind Regards



Matt



P.S. I did a little more digging - if I use require_once 'Console_Getopt.php' on a standalone file it works fine (change the filename and I get an error), and if I edit compile_locale.php to remove the stuff below line 57 it works fine. So it's almost like there is something else in compile_locale.php that is breaking the script. All very strange - or maybe I am missing something fundamental?



P.P.S. It looks like the issue related to having safe_mode set to On in the version /etc/php5/cli/php.ini. Once I changed it to On, everything seems to be fine. Sorry if that was a dumb thing that I should have thought of before. Step_03 seemed to run fine so hopefully I'll soon have the site up and running. Thanks again. Matt