Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP warning message - PHP Notice: Undefined offset: 0 #295

Closed
balwant-sd opened this issue Oct 29, 2018 · 10 comments
Closed

PHP warning message - PHP Notice: Undefined offset: 0 #295

balwant-sd opened this issue Oct 29, 2018 · 10 comments
Labels

Comments

@balwant-sd
Copy link

balwant-sd commented Oct 29, 2018

Hi,

I simply download linux package and unzip this in my home directory.
I use ubuntu 14.04.
after unzip i also change current directory in cli.
After this i enter

desktop:~/Desktop/tagui/src$ ./tagui samples/1_yahoo

then it will show a error

per@per-desktop:~/Desktop/tagui/src$ ./tagui samples/1_yahoo PHP Notice: Undefined offset: 0 in /home/per/Desktop/tagui/src/tagui_parse.php on line 33 PHP Notice: Undefined offset: 0 in /home/per/Desktop/tagui/src/tagui_parse.php on line 33 PHP Notice: Undefined offset: 0 in /home/per/Desktop/tagui/src/tagui_parse.php on line 33 PHP Notice: Undefined offset: 0 in /home/per/Desktop/tagui/src/tagui_parse.php on line 33 PHP Notice: Undefined offset: 0 in /home/per/Desktop/tagui/src/tagui_parse.php on line 33 PHP Notice: Undefined offset: 0 in /home/per/Desktop/tagui/src/tagui_parse.php on line 33 PHP Notice: Undefined offset: 0 in /home/per/Desktop/tagui/src/tagui_parse.php on line 33 ERROR - Fatal: No such file or directory; did you install phantomjs?

Suggest What Should I Do ???

@kensoh

I am new to this tech world, so if there are any mistakes in explaining, please ignore them.

@Aussiroth
Copy link
Contributor

Hi, it seems like phantomjs is missing from your installation or cannot be found, can you check that the directory tagui/src/phantomjs exists and is not empty?

@balwant-sd
Copy link
Author

phantomjs exists in tagui/src/phantomjs

screenshot from 2018-10-31 12-52-38

@kensoh
Copy link
Member

kensoh commented Nov 1, 2018

Hi @balwant-sd I tried running on Ubuntu, I get a similar PHP notice, perhaps something to do with the differences between Ubuntu shell and normal Linux shell, but the execution run ok with PhantomJS. The php version on the Ubuntu is v7.0 (with apt-get install php).

Couldn't think of why PJS can't be found. Perhaps your home folder full path has a space or invalid character in the name? This issue probably can't be solved as it can't be replicated - probably need more users to report this if they experience similar issues, so that there can be a way to replicate.

Hopefully we have other users experiencing this issue and can report their findings. In the meantime, hopefully you can have access to Windows laptop, masOS laptop, or other Linux laptops to use TagUI. If you do not have other laptops, the only other alternative I can think of is manually installing all the dependencies of TagUI, including PhantomJS, and see if that helps.

https://github.com/kelaberetiv/TagUI#manual-installation

@kensoh kensoh changed the title Samples Does Not Run PHP warning message - PHP Notice: Undefined offset: 0 Nov 2, 2018
@kensoh kensoh added the bug label Nov 2, 2018
kensoh added a commit that referenced this issue Nov 2, 2018
#289 - enclose wait step with casper.then() in order to make dynamic wait delay in scope for access

#295 - PHP 7 issues warning message which is not observed with PHP 5. this change avoids an empty $repo_data[0], by removing the increment step that start filling elements from $repo_data[1]
@kensoh
Copy link
Member

kensoh commented Nov 2, 2018

Hi @Aussiroth, I created PR #304 on a patch-289-295 branch for your review and testing, prior to commit by @ryzalk. Below are the details.

#289 - enclose wait step with casper.then() in order to make dynamic wait delay in scope for access. for consideration to commit since CK has not gotten back after quite a while.

#295 - PHP 7 issues warning message which is not observed with PHP 5. this change avoids an empty $repo_data[0], by removing the increment step that start filling elements from $repo_data[1]. after the change, the array starts filling from element 0 and thus won't show warning on PHP 7. Probably can test with repository, and also repository + datatable to verify all is good. Previously PHP 5 simply ignores the empty element 0 without showing warning.

This should resolve the PHP warning messages for this issue. For the missing PhantomJS, it looks like @balwant-sd has already resolved thus he raised another issue #303 on Chrome. He hasn't updated here though. But non-issue for now as it can't be replicated - I borrowed an Ubuntu 14.04 computer and ran the yahoo sample from the Linux zip without issues.

kensoh added a commit that referenced this issue Nov 3, 2018
#289 - enclose wait step with casper.then() in order to make dynamic wait delay in scope for access

#295 - PHP 7 issues warning message which is not observed with PHP 5. this change removes the warning by avoiding an empty $repo_data[0]. ie increment repo_count only if there is already data in the array, otherwise discard header and start filling from $repo_data[0].
kensoh added a commit to tebelorg/TagUI that referenced this issue Nov 3, 2018
aisingapore#289 - enclose wait step with casper.then() in order to make dynamic wait delay in scope for access

aisingapore#295 - PHP 7 issues warning message which is not observed with PHP 5. this change removes the warning by avoiding an empty $repo_data[0]. ie increment repo_count only if there is already data in the array, otherwise discard header and start filling from $repo_data[0]. For the datatable (custom_csv_file portion), don't drop header as there is a dummy [iteration] header to let users reference current datatable iteration number.
@kensoh
Copy link
Member

kensoh commented Nov 3, 2018

Made an update to the PR, taking into consideration the [iteration] header for datatables and letting the repo_data array form properly if a datatable and repository are both used in an automation flow.

#289 - enclose wait step with casper.then() in order to make dynamic wait delay in scope for access

#295 - PHP 7 issues warning message which is not observed with PHP 5. this change removes the warning by avoiding an empty $repo_data[0]. ie increment repo_count only if there is already data in the array, otherwise just discard header without incrementing and start filling from $repo_data[0]. For the datatable (custom_csv_file portion), don't drop header as there is a dummy [iteration] header to let users reference current datatable iteration number.

@balwant-sd
Copy link
Author

Thanks for your attention & help @kensoh. I have access of Windows Laptop. So, I will use that.

@chadzilla2080
Copy link

I'm also having this issue as well and running Ubuntu 18.04. I even went as far as installing phantomjs globally and locally into the application and it produces the same error. I'm not sure about the last comment from kensoh

ryzalk added a commit that referenced this issue Nov 10, 2018
@kensoh
Copy link
Member

kensoh commented Nov 12, 2018

Oh the issue on the PHP warning message should be resolved by using the cutting edge version - https://github.com/kelaberetiv/TagUI#set-up

For issue on PhantomJS not found error message, I was not able to replicate on an Ubuntu computer I borrowed. I downloaded the Linux packaged zip, unzip and able to run the sample flow directly without issues.

Are you familiar with bash scripting? If you are, can you debug src/tagui why the PHANTOMJS_EXECUTABLE variable is not set correctly. If you are not familiar, maybe you can try adding this line echo $PHANTOMJS_EXECUTABLE just before the line # set default web browser to be used to phantomjs in src/tagui. That will output the filepath of the detected PhantomJS and could help with further troubleshooting. From my borrowed Ubuntu (now returned) no such problem with execution.

Copying @Aussiroth who is maintaining TagUI now. #289 and this issue #295 can probably be closed after putting a note to applying cutting edge release - https://github.com/kelaberetiv/TagUI#set-up since the PR had been applied to master branch. Also, not sure if folks at AI Singapore office have an Ubuntu distribution to try replicate and test. For me on the borrowed computer I can unzip and run without issues.

@kensoh
Copy link
Member

kensoh commented Nov 19, 2018

Hey Alvin, I'll just close this since no further replication details above -

The PHP warning message is already fixed for users with PHP7. They can download from cutting edge version to overwrite their location installation - https://github.com/kelaberetiv/TagUI#set-up

The other issue on unable to find phantomjs on Ubuntu, I can't replicate on a borrowed Ubuntu, thus closing since no further replication details above to be able to replicate the error message.

@kensoh kensoh closed this as completed Nov 19, 2018
@kensoh
Copy link
Member

kensoh commented Nov 14, 2019

Cross-link to another warning from PHP 7, which is already fixed in the cutting edge release.

For more details, see #597 - that one is a warning message for count()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants