Bug #76330 [Opn]: XPath only works in a linux server not local windows IIS
| From: | peehaa@php.net | Date: | Fri, 11 May 2018 15:57:49 +0000 |
| Subject: | Bug #76330 [Opn]: XPath only works in a linux server not local windows IIS | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-215209@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76330&edit=1
ID: 76330
Updated by: peehaa@php.net
Reported by: kj-8791 at hotmail dot com
Summary: XPath only works in a linux server not local windows
IIS
Status: Open
Type: Bug
Package: *XML functions
Operating System: windows 10 enterprise
PHP Version: 7.2.5
Block user comment: N
Private report: N
New Comment:
Are you sure $data is actually null or do you get a fatal error?
Previous Comments:
------------------------------------------------------------------------
[2018-05-11 15:36:28] kj-8791 at hotmail dot com
retrive from
@id="technical_summary_container"]/table/tbody/tr[3]/td[2]
# should show one of this and it does in linux but not in windows #
Strong Sell
Sell
Neutral
Buy
Strong Buy
------------------------------------------------------------------------
[2018-05-11 15:31:22] kj-8791 at hotmail dot com
Yes i have removed @ and it doesn't show anything, totally empty
when checking the page direct i only see a white page, when i use http request from javascript from
another page to retrive "xpath page" is shows undefined, but this is only in a local
windows 10 testing enviroment, if i upload to a linux server it works, but it should work locally as
i use webserver IP not localhost as i have read that localhost have security limits when retriveng
data from another server on internet
i can retrive all other pages so webserver works
------------------------------------------------------------------------
[2018-05-11 15:18:22] peehaa@php.net
Also make sure the data you get in is what you think it is.
------------------------------------------------------------------------
[2018-05-11 15:17:24] peehaa@php.net
You are using the STFU operator (@) which prevent you from seeing what is going wrong.
Remove it and check the error message.
------------------------------------------------------------------------
[2018-05-11 15:13:51] kj-8791 at hotmail dot com
Description:
------------
problem is only $data is null in a local windows IIS even if i connect a domain to my localhost, so
a question is Windows 10 Enterprise lacking something default as PHP stats XPath is integrated and
is working in a linux enviroment??
i have PHP 7.2.5 plus Microsoft VC15 runtime
no changes are made to the system files standard installation of PHP
Question? What is needed for this to work in windows?
as Windows Enterprise should have all needed because PHP code works
Test script:
---------------
//Get parsing url for retrieving forex data
$parseurl="https://www.investing.com/technical/technical-summary";
//Create XPath object
$parsedoc=new DOMDocument();@$parsedoc->loadHTMLFile($parseurl);$xpath=new DOMXPath($parsedoc);
$data=$xpath->query('//*[@id="technical_summary_container"]/table/tbody/tr[3]/td[2]')->item(0)->nodeValue."\n";
echo $data;
Expected result:
----------------
$data should have one of this results
Strong Sell
Sell
Neutral
Buy
Strong Buy
Actual result:
--------------
$data is null in a windows 10 Enterprise PHP standard installation, without plugins and external
packages
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76330&edit=1