Installation prevented by red PHP CLI error

Ask your questions regarding TimeTrex installation here.
Locked
NickBlakey
Posts: 11
Joined: Wed Apr 23, 2014 4:42 am

Installation prevented by red PHP CLI error

Post by NickBlakey »

Hi,

I am a new user, trying to evaluate TimeTrex for use in a small studio.

I have set up a VirtualBox virtual machine based on an installation of a TurnKey LAPP server. This runs a base install of Debian 7.2 (Wheezy), configured with Apache 2.2.22, PostgreSQL 9.1.12 and PHP 5.4.4-14+deb7u8 (I tried using the LAMP stack from TurnKey but soon got the warning during install that MySQL is not the preferred option for the number of users).

It is a fresh install of TimeTrex 7.3.5. Before installing (from the zip) I used apt-get to install php5-gd. After unzipping I renamed the TimeTrex folder (in /var/www/) to timetrex (to remove any problems from capitalisation), created the folders /var/www/log/timetrex, /var/www/timetrex/storage and /var/www/tmp/timetrex and then chmodded all these folders and the timetrex folders to 777 (insecure, I know, but it is a closed system and only a trial at the moment). I then updated the php.ini file to increase the memory limit to 128M.

After a restart, I pointed a browser at the install.php and at the system check all is OK apart from the PHP CLI requirements which is showing the red warning shown in the attached screenshot.

The screenshot was created after enabling debugging, so I have included the extended page.

Any help resolving this issue would be greatly appreciated.
Screen Shot
Screen Shot
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: Installation prevented by red PHP CLI error

Post by shaunw »

There are often two php.ini files, one for Apache and one for the CLI, make sure you update both.
NickBlakey
Posts: 11
Joined: Wed Apr 23, 2014 4:42 am

Re: Installation prevented by red PHP CLI error

Post by NickBlakey »

shaunw wrote:There are often two php.ini files, one for Apache and one for the CLI, make sure you update both.
Thanks, shaunw,

Apologies: I should have been more clear in my initial post. I updated the php.ini files in both locations (/etc/php5/cli/ and /etc/php5/apache2/) only changing the single entry for memory_limit to 128M in each file.

Your reply did prompt me to run diff on the two files and I discovered a mismatch in disable_functions. To check if this was the problem I duplicated the php.ini files (both ways) and restarted the VM.

Using both twinned versions of the php.ini file I still got exactly the same error (I have also run a find to check that there are no other php.ini files scattered over the system, not that I expected to find any...) which leads me to suspect that the suggestion to check for differing php.ini files is a red herring.
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: Installation prevented by red PHP CLI error

Post by shaunw »

Can you copy and paste the debug log at the bottom of your screenshot here, not as a screenshot, but just as regular text?
NickBlakey
Posts: 11
Joined: Wed Apr 23, 2014 4:42 am

Re: Installation prevented by red PHP CLI error

Post by NickBlakey »

Here is the text, as requested:

Debug Buffer
============================================================================
Memory Usage: 4546800 Buffer Size: 83
----------------------------------------------------------------------------
DEBUG [L0411] [36ms]: [Function](): URI: /timetrex/interface/install/Requirements.php?external_installer=0 IP Address: 192.168.13.10
DEBUG [L0413] [37ms]: [Function](): Version: 7.3.5 Edition: 10 Production: 1 Database: Type: mysqli Name: timetrex Config: /var/www/timetrex/includes/../timetrex.ini.php Demo Mode: 0
DEBUG [L0167] [56ms]: TTDate::setTimeZone(): Setting TimeZone: UTC
DEBUG [L0085] [81ms]: [Function](): Bypassing Authentication
DEBUG [L0418] [93ms]: TTi18n::getBrowserLanguage(): HTTP_ACCEPT_LANGUAGE: en-GB,en-US;q=0.8,en;q=0.6
DEBUG [L0259] [93ms]: TTi18n::tryLocale(): FAILED TRYING LOCALE: en_GB,en_GB.UTF-8,en_US,en_US.UTF-8,en,en.UTF-8
DEBUG [L0259] [93ms]: TTi18n::tryLocale(): FAILED TRYING LOCALE: en_US,en_US.UTF-8,en,en.UTF-8
DEBUG [L0259] [93ms]: TTi18n::tryLocale(): FAILED TRYING LOCALE: en,en.UTF-8,en_US,en_US.UTF-8
DEBUG [L0522] [93ms]: TTi18n::chooseBestLocale(): Unable to find and set a locale.
DEBUG [L1897] [104ms]: Misc::detectMobileBrowser(): User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.116 Safari/537.36 Retval:
DEBUG [L0110] [117ms]: Install::isInstallMode(): Install Mode is ON
DEBUG [L0647] [117ms]: Install::checkPHPVersion(): Comparing with Version: 5.4.4-14+deb7u8
DEBUG [L1036] [5193ms] Array: Install::checkBaseURL(): Checking Base URL: http://localhost:80/timetrex/interface/ ... nstall.php
bool(false)


DEBUG [L1053] [5193ms]: Install::checkPHPOpenBaseDir(): Open BaseDir:
DEBUG [L1097] [6048ms] Array: Install::checkPHPCLIRequirements(): PHP CLI Requirements Command: "/usr/bin/php" "/var/www/timetrex//tools/unattended_upgrade.php" --config "/var/www/timetrex/includes/../timetrex.ini.php" --requirements_only --web_installer Output:
array(0) {
}


DEBUG [L0647] [11067ms]: Install::checkPHPVersion(): Comparing with Version: 5.4.4-14+deb7u8
DEBUG [L1036] [16109ms] Array: Install::checkBaseURL(): Checking Base URL: http://localhost:80/timetrex/interface/ ... nstall.php
bool(false)


DEBUG [L1053] [16109ms]: Install::checkPHPOpenBaseDir(): Open BaseDir:
DEBUG [L1097] [16981ms] Array: Install::checkPHPCLIRequirements(): PHP CLI Requirements Command: "/usr/bin/php" "/var/www/timetrex//tools/unattended_upgrade.php" --config "/var/www/timetrex/includes/../timetrex.ini.php" --requirements_only --web_installer Output:
array(0) {
}


DEBUG [L0808] [16981ms]: Install::checkFilePermissions(): Checking directory readable/writable: /var/www/tmp/timetrex
DEBUG [L0808] [16993ms]: Install::checkFilePermissions(): Checking directory readable/writable: /var/www/log/timetrex
DEBUG [L0808] [16993ms]: Install::checkFilePermissions(): Checking directory readable/writable: /var/www/timetrex/storage
DEBUG [L0808] [16993ms]: Install::checkFilePermissions(): Checking directory readable/writable: /var/www/timetrex/templates_c/
DEBUG [L0808] [17004ms]: Install::checkFilePermissions(): Checking directory readable/writable: /var/www/timetrex/classes/modules/install/../../../
DEBUG [L0837] [19681ms]: Install::checkFilePermissions(): All Files/Directories are readable/writable!
DEBUG [L0866] [19705ms]: Install::checkFileChecksums(): Checksum version: 7.3.5
DEBUG [L0868] [19705ms]: Install::checkFileChecksums(): Checksum version matches!
DEBUG [L0647] [25653ms]: Install::checkPHPVersion(): Comparing with Version: 5.4.4-14+deb7u8
DEBUG [L1036] [30761ms] Array: Install::checkBaseURL(): Checking Base URL: http://localhost:80/timetrex/interface/ ... nstall.php
bool(false)


DEBUG [L1053] [30761ms]: Install::checkPHPOpenBaseDir(): Open BaseDir:
DEBUG [L1097] [31613ms] Array: Install::checkPHPCLIRequirements(): PHP CLI Requirements Command: "/usr/bin/php" "/var/www/timetrex//tools/unattended_upgrade.php" --config "/var/www/timetrex/includes/../timetrex.ini.php" --requirements_only --web_installer Output:
array(0) {
}


DEBUG [L0808] [31613ms]: Install::checkFilePermissions(): Checking directory readable/writable: /var/www/tmp/timetrex
DEBUG [L0808] [31613ms]: Install::checkFilePermissions(): Checking directory readable/writable: /var/www/log/timetrex
DEBUG [L0808] [31624ms]: Install::checkFilePermissions(): Checking directory readable/writable: /var/www/timetrex/storage
DEBUG [L0808] [31625ms]: Install::checkFilePermissions(): Checking directory readable/writable: /var/www/timetrex/templates_c/
DEBUG [L0808] [31625ms]: Install::checkFilePermissions(): Checking directory readable/writable: /var/www/timetrex/classes/modules/install/../../../
DEBUG [L0837] [35353ms]: Install::checkFilePermissions(): All Files/Directories are readable/writable!
DEBUG [L0866] [35401ms]: Install::checkFileChecksums(): Checksum version: 7.3.5
DEBUG [L0868] [35401ms]: Install::checkFileChecksums(): Checksum version matches!
DEBUG [L0647] [47932ms]: Install::checkPHPVersion(): Comparing with Version: 5.4.4-14+deb7u8
DEBUG [L1036] [52963ms] Array: Install::checkBaseURL(): Checking Base URL: http://localhost:80/timetrex/interface/ ... nstall.php
bool(false)


DEBUG [L1053] [52963ms]: Install::checkPHPOpenBaseDir(): Open BaseDir:
DEBUG [L1097] [53768ms] Array: Install::checkPHPCLIRequirements(): PHP CLI Requirements Command: "/usr/bin/php" "/var/www/timetrex//tools/unattended_upgrade.php" --config "/var/www/timetrex/includes/../timetrex.ini.php" --requirements_only --web_installer Output:
array(0) {
}


DEBUG [L0808] [53780ms]: Install::checkFilePermissions(): Checking directory readable/writable: /var/www/tmp/timetrex
DEBUG [L0808] [53781ms]: Install::checkFilePermissions(): Checking directory readable/writable: /var/www/log/timetrex
DEBUG [L0808] [53781ms]: Install::checkFilePermissions(): Checking directory readable/writable: /var/www/timetrex/storage
DEBUG [L0808] [53781ms]: Install::checkFilePermissions(): Checking directory readable/writable: /var/www/timetrex/templates_c/
DEBUG [L0808] [53781ms]: Install::checkFilePermissions(): Checking directory readable/writable: /var/www/timetrex/classes/modules/install/../../../
DEBUG [L0837] [56089ms]: Install::checkFilePermissions(): All Files/Directories are readable/writable!
DEBUG [L0866] [56112ms]: Install::checkFileChecksums(): Checksum version: 7.3.5
DEBUG [L0868] [56113ms]: Install::checkFileChecksums(): Checksum version matches!
DEBUG [L0647] [61541ms]: Install::checkPHPVersion(): Comparing with Version: 5.4.4-14+deb7u8
DEBUG [L1036] [66600ms] Array: Install::checkBaseURL(): Checking Base URL: http://localhost:80/timetrex/interface/ ... nstall.php
bool(false)


DEBUG [L1053] [66600ms]: Install::checkPHPOpenBaseDir(): Open BaseDir:
DEBUG [L1097] [67544ms] Array: Install::checkPHPCLIRequirements(): PHP CLI Requirements Command: "/usr/bin/php" "/var/www/timetrex//tools/unattended_upgrade.php" --config "/var/www/timetrex/includes/../timetrex.ini.php" --requirements_only --web_installer Output:
array(0) {
}


DEBUG [L0808] [67545ms]: Install::checkFilePermissions(): Checking directory readable/writable: /var/www/tmp/timetrex
DEBUG [L0808] [67545ms]: Install::checkFilePermissions(): Checking directory readable/writable: /var/www/log/timetrex
DEBUG [L0808] [67545ms]: Install::checkFilePermissions(): Checking directory readable/writable: /var/www/timetrex/storage
DEBUG [L0808] [67545ms]: Install::checkFilePermissions(): Checking directory readable/writable: /var/www/timetrex/templates_c/
DEBUG [L0808] [67557ms]: Install::checkFilePermissions(): Checking directory readable/writable: /var/www/timetrex/classes/modules/install/../../../
DEBUG [L0837] [69985ms]: Install::checkFilePermissions(): All Files/Directories are readable/writable!
DEBUG [L0866] [70009ms]: Install::checkFileChecksums(): Checksum version: 7.3.5
DEBUG [L0868] [70009ms]: Install::checkFileChecksums(): Checksum version matches!
============================================================================
============================================================================
PROFILER OUTPUT
============================================================================
Calls Time Routine
-----------------------------------------------------------------------------
1 75475.8558 ms (99.88 %) Main
16 48.9154 ms (0.06 %) __autoload
1 31.5101 ms (0.04 %) unprofiled

12.4166 ms (0.02 %) Missed
============================================================================
75568.6979 ms (100.00 %) OVERALL TIME
============================================================================
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: Installation prevented by red PHP CLI error

Post by shaunw »

What is the output if you run the following from a shell:

Code: Select all

"/usr/bin/php" "/var/www/timetrex//tools/unattended_upgrade.php" --config "/var/www/timetrex/includes/../timetrex.ini.php" --requirements_only --web_installer; echo $?
Then what about the output of these commands:

Code: Select all

su www-data
"/usr/bin/php" "/var/www/timetrex//tools/unattended_upgrade.php" --config "/var/www/timetrex/includes/../timetrex.ini.php" --requirements_only --web_installer; echo $?
NickBlakey
Posts: 11
Joined: Wed Apr 23, 2014 4:42 am

Re: Installation prevented by red PHP CLI error

Post by NickBlakey »

Hi shaunw,

Thanks for your help:

The output from both commands is: 255
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: Installation prevented by red PHP CLI error

Post by shaunw »

Thats odd, sounds like a fatal PHP error is happening somewhere.

Whats the output of:

Code: Select all

"/usr/bin/php" -v
and:

Code: Select all

"/usr/bin/php" "/var/www/timetrex//tools/unattended_upgrade.php"
NickBlakey
Posts: 11
Joined: Wed Apr 23, 2014 4:42 am

Re: Installation prevented by red PHP CLI error

Post by NickBlakey »

Here are the results as requested

From /usr/bin/php -v:

PHP 5.4.4-14+deb7u8 (cli) (built: Feb 17 2014 09:18:47)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
with XCache v2.0.0, Copyright (c) 2005-2012, by mOo

I get nothing from unattended_upgrade.php (just returns to shell prompt).
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: Installation prevented by red PHP CLI error

Post by shaunw »

Lets try a different script to see if does the same thing, what is the output of:

Code: Select all

"/usr/bin/php" "/var/www/timetrex//tools/create_demo_data.php"
NickBlakey
Posts: 11
Joined: Wed Apr 23, 2014 4:42 am

Re: Installation prevented by red PHP CLI error

Post by NickBlakey »

Hi shaunw,

Once again I get nothing from create_demo_data.php, just returns to the shell prompt.

Nick
NickBlakey
Posts: 11
Joined: Wed Apr 23, 2014 4:42 am

Re: Installation prevented by red PHP CLI error

Post by NickBlakey »

Just FYI, and to provide as much data as possible, I have included the two php files directly from my install.
Attachments
unattended_upgrade.txt
(23.74 KiB) Downloaded 682 times
create_demo_data.txt
(2.39 KiB) Downloaded 647 times
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: Installation prevented by red PHP CLI error

Post by shaunw »

Okay, one last thing to check:

Code: Select all

"/usr/bin/php" "/var/www/timetrex//tools/create_demo_data.php" ; echo $?
That above command return "0", if it returns 255 there is likely something wrong with your PHP CLI causing it to fail. The above command isn't actually doing anything, it should just return the command line arguments for the "create_demo_data" script, its about as basic as it gets, so for it to fail something definitely isn't setup correctly.
NickBlakey
Posts: 11
Joined: Wed Apr 23, 2014 4:42 am

Re: Installation prevented by red PHP CLI error

Post by NickBlakey »

Hi shaunw,

Thanks for your patience with this.

Your command returns 255, so something is wrong.

The PHP CLI isn't totally fritzed, though, I ran the following command sequence:

Code: Select all

echo '<?php echo "test\n"; ?>' > test.php
php -q test.php
and got the expected "test" output as a result.

Not sure where to go from here. Any suggestions?
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: Installation prevented by red PHP CLI error

Post by shaunw »

There is likely some fatal error occurring that should be appearing in your PHP error log if its enabled.

Though its not very nice to try and search through, you could try doing this and posting the output here:

Code: Select all

strace -s 1024 /usr/bin/php /var/www/timetrex//tools/create_demo_data.php
You could also try to edit the above created_demo_data.php file and put:

Code: Select all

error_reporting(E_ALL);
ini_set('display_errors', '1');
Just below the first line containing "<?php", that may help force any errors to be displayed next time you run the command.
NickBlakey
Posts: 11
Joined: Wed Apr 23, 2014 4:42 am

Re: Installation prevented by red PHP CLI error

Post by NickBlakey »

Hi shaunw.

I have attached the output of the strace command you suggested.

I notice it starts with a fair number of "no such file or directory" warnings, but I am reaching (surpassing) my limits in troubleshooting :)

Are these files that should have been created during the install, or are they just spurious errors?
Attachments
strace-output.txt
(216.55 KiB) Downloaded 668 times
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: Installation prevented by red PHP CLI error

Post by shaunw »

The no such file or directory are normal when viewing strace output... There is definitely a fatal error happening somewhere, but unfortunately I'm not sure whats causing it, my best guess is its related to connecting to your database.

You will need to figure out why PHP is not printing the error message before we will be able to assist you much further. Did you try enabling display_errors as described in the previous post?
NickBlakey
Posts: 11
Joined: Wed Apr 23, 2014 4:42 am

Re: Installation prevented by red PHP CLI error

Post by NickBlakey »

Hi shaunw,

I have run the same command after adding the lines requested, but the output appears to be (virtually) the same. The only changes appear to be time and address references.

I have uploaded so that you can check.
Attachments
strace2-text.txt
(216.66 KiB) Downloaded 678 times
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: Installation prevented by red PHP CLI error

Post by shaunw »

Unfortunately without getting the error message that is occurring, I don't think there is much more we can do to help you unless you are willing to purchase a support package and give us access to your server.
NickBlakey
Posts: 11
Joined: Wed Apr 23, 2014 4:42 am

Re: Installation prevented by red PHP CLI error

Post by NickBlakey »

Hi shaunw,

Many thanks for your help thus far.

Unfortunately, as this was just an install for evaluation, it is unlikely that I will be able to get approval for a CapEx for a support package without being able to prove it will be of use to us.

I will try to spend some more time troubleshooting, but as all other php applications appear to be working as expected I am afraid that I will probably end up leaving it...

I will also keep an eye on the support forums to see if anyone else has resolved a similar issue.

Kind Regards,
Nick
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: Installation prevented by red PHP CLI error

Post by shaunw »

If its just for evaluation purposes, you could always try our Cloud Hosted Free Trial instead, or the automated installer, even though we don't recommend that on modern Linux distributions for production use.
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: Installation prevented by red PHP CLI error

Post by shaunw »

I was informed by our developers that this issue should be resolved (or at least report a more useful error message) when v7.3.7 or higher of TimeTrex is released. It appeared to be caused by incorrect settings in the timetrex.ini.php file (ie: missing database settings), of course if the timetrex.ini.php is corrected it will allow you to continue the installation.
Locked