Alright so. I have a relative simple task. Here is the fully functional working code of a query that does work. It works
<?php
$query = array(
'address'=>'https://mcapi.ca/query/94.12.141.113:25577/info'); //Grab statistics from URL.
$response = json_decode(file_get_contents($query['address']), true); //Decode the JSON response.
?>
It works. I've seen it work with my own two eyes.
The problem is now that I'm hosting the file. (obviously it has html code for the web page where the result of this query is called and displayed on the page(which also works)). When I host the file on my apache webserver which has been port forwarded and what have you - it's online. I go to the page.... scroll to the bottom and find that there are no results for this query. So my thinking is that apache is blocking links to other sites from within the files for some security reasons... sod that I want to see my results. So anyone know of such a setting? Maybe even a file that I can go and visit to change said setting?
Now what I want to know:
Is it the code?
if so how can I fix it?
Is it a setting in the webserver?
if so... you guessed it... how can I fix it?
and if it is none of the above... what is it?
Any and all help is much appreciated.
This is the error log as requested
[Sun Jan 01 14:18:42.055662 2017] [:error] [pid 5052:tid 1068] [client ::1:49636] PHP Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in C:\\Apache24\\htdocs\\index.php on line 4
[Sun Jan 01 14:18:42.055662 2017] [:error] [pid 5052:tid 1068] [client ::1:49636] PHP Warning: file_get_contents(https://mcapi.ca/query/94.12.141.113:25577/info): failed to open stream: Invalid argument in C:\\Apache24\\htdocs\\index.php on line 4
[Sun Jan 01 14:18:46.248600 2017] [:error] [pid 5052:tid 1068] [client ::1:49636] PHP Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in C:\\Apache24\\htdocs\\gallery.php on line 4, referer: http://localhost/
[Sun Jan 01 14:18:46.248600 2017] [:error] [pid 5052:tid 1068] [client ::1:49636] PHP Warning: file_get_contents(https://mcapi.ca/query/94.12.141.113:25577/info): failed to open stream: Invalid argument in C:\\Apache24\\htdocs\\gallery.php on line 4, referer: http://localhost/
[Sun Jan 01 14:18:47.697728 2017] [:error] [pid 5052:tid 1068] [client ::1:49636] PHP Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in C:\\Apache24\\htdocs\\about.php on line 4, referer: http://localhost/gallery.php
[Sun Jan 01 14:18:47.697728 2017] [:error] [pid 5052:tid 1068] [client ::1:49636] PHP Warning: file_get_contents(https://mcapi.ca/query/94.12.141.113:25577/info): failed to open stream: Invalid argument in C:\\Apache24\\htdocs\\about.php on line 4, referer: http://localhost/gallery.php
[Sun Jan 01 14:18:48.495928 2017] [:error] [pid 5052:tid 1068] [client ::1:49636] PHP Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in C:\\Apache24\\htdocs\\index.php on line 4, referer: http://localhost/about.php
[Sun Jan 01 14:18:48.495928 2017] [:error] [pid 5052:tid 1068] [client ::1:49636] PHP Warning: file_get_contents(https://mcapi.ca/query/94.12.141.113:25577/info): failed to open stream: Invalid argument in C:\\Apache24\\htdocs\\index.php on line 4, referer: http://localhost/about.php
[Sun Jan 01 14:34:21.958403 2017] [:error] [pid 5052:tid 1084] [client ::1:49819] PHP Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in C:\\Apache24\\htdocs\\index.php on line 4
[Sun Jan 01 14:34:21.958403 2017] [:error] [pid 5052:tid 1084] [client ::1:49819] PHP Warning: file_get_contents(https://mcapi.ca/query/94.12.141.113:25577/info): failed to open stream: Invalid argument in C:\\Apache24\\htdocs\\index.php on line 4
Related
I have created a website and just uploaded it on a virtual host, but when I try accessing it I get the "This page isn’t working (HTTP ERROR 500)" and I got this from the error log file, I understand it is something to do with the file paths but I don't know how to fix it. does anyone know how to fix it?
[Sun Dec 20 00:18:28.000823 2020] [fcgid:warn] [pid 2449] [client 89.168.52.229:52594] mod_fcgid: stderr: PHP Warning: require(/home/ae504/public_html/AuctionSystem/View/Template/header.phtml): failed to open stream: No such file or directory in /home/aee504/public_html/AuctionSystem/View/index.phtml on line 1
[Sun Dec 20 00:18:28.000849 2020] [fcgid:warn] [pid 2449] [client 89.168.52.229:52594] mod_fcgid: stderr: PHP Stack trace:
[Sun Dec 20 00:18:28.000853 2020] [fcgid:warn] [pid 2449] [client 89.168.52.229:52594] mod_fcgid: stderr: PHP 1. {main}() /home/aee504/public_html/AuctionSystem/index.php:0
[Sun Dec 20 00:18:28.000856 2020] [fcgid:warn] [pid 2449] [client 89.168.52.229:52594] mod_fcgid: stderr: PHP 2. require_once() /home/aee504/public_html/AuctionSystem/index.php:5
[Sun Dec 20 00:18:28.000859 2020] [fcgid:warn] [pid 2449] [client 89.168.52.229:52594] mod_fcgid: stderr: PHP Fatal error: require(): Failed opening required '/home/ae504/public_html/AuctionSystem/View/Template/header.phtml' (include_path='.:/usr/share/php') in /home/aee504/public_html/AuctionSystem/View/index.phtml on line 1
[Sun Dec 20 00:18:28.000862 2020] [fcgid:warn] [pid 2449] [client 89.168.52.229:52594] mod_fcgid: stderr: PHP Stack trace:
[Sun Dec 20 00:18:28.000865 2020] [fcgid:warn] [pid 2449] [client 89.168.52.229:52594] mod_fcgid: stderr: PHP 1. {main}() /home/aee504/public_html/AuctionSystem/index.php:0
[Sun Dec 20 00:18:28.000868 2020] [fcgid:warn] [pid 2449] [client 89.168.52.229:52594] mod_fcgid: stderr: PHP 2. require_once() /home/aee504/public_html/AuctionSystem/index.php:5
/home/ae504/public_html/AuctionSystem/View/Template/header.phtml
The file doesn't exist or is not readable. Simple *nix error
Either your templating engine is not producing it, or it is being produced but not readable. Given your error report, there is no way of telling. Suggest you go look at whatever framework you are using.
I have the following key but get an apache error when I try to run the code.
<xsl:key name="dt" match="//eprint[substring(date,1,4) >= $year]" use="substring(date,1,4)" />
The error I get is:
[Thu Jul 12 10:51:18.724468 2018] [php7:warn] [pid 24089] [client 127.0.0.1:34808] PHP Warning: XSLTProcessor::importStylesheet(): Forbidden variable in /home/david/Documents/staffpub/inc/staff.php on line 54, referer: http://localhost:81/test_jsonp.html
[Thu Jul 12 10:51:18.724614 2018] [php7:warn] [pid 24089] [client 127.0.0.1:34808] PHP Warning: XSLTProcessor::importStylesheet(): compilation error: file /home/david/Documents/staffpub/inc/sorts/year.xsl line 5 element key in /home/david/Documents/staffpub/inc/staff.php on line 54, referer: http://localhost:81/test_jsonp.html
[Thu Jul 12 10:51:18.724634 2018] [php7:warn] [pid 24089] [client 127.0.0.1:34808] PHP Warning: XSLTProcessor::importStylesheet(): xsl:key : 'match' pattern compilation failed '//eprint[substring(date,1,4) >= $year]' in /home/david/Documents/staffpub/inc/staff.php on line 54, referer: http://localhost:81/test_jsonp.html
[Thu Jul 12 10:51:18.732938 2018] [php7:warn] [pid 24089] [client 127.0.0.1:34808] PHP Warning: XSLTProcessor::transformToXml(): No stylesheet associated to this object in /home/david/Documents/staffpub/inc/staff.php on line 59, referer: http://localhost:81/test_jsonp.html
I guess there is something wrong with the key set up, but I am unsure what.
Is anyone able to point me in the right direction?
A sample data set is
<?xml version='1.0' encoding='utf-8'?>
<eprints xmlns='http://eprints.org/ep2/data/2.0'>
<eprint id='http://dsfdsfs'>
<eprintid>3424243242423</eprintid>
<date>2012-12</date>
</eprint>
I have a simple website deployed on Elastic BeanTalk ( platform: PHP 5.6 ).
public
|about.html
|index.html
|style.css
|+ include
|subscribe-email.php
|+ phpmailer
When I checked the log, I received many errors related to '.php' not found or unable to stat. I don't know from where these php files were generated.
[Thu Jun 21 06:18:52.967190 2018] [:error] [pid 12523] [client xxx] script '/var/www/html/xxxx/public/wp-login.php' not found or unable to stat
[Thu Jun 21 06:25:46.354172 2018] [:error] [pid 12742] [client xxx] script '/var/www/html/xxxx/public/wp-login.php' not found or unable to stat
[Thu Jun 21 06:44:44.392342 2018] [:error] [pid 12963] [client xxx] script '/var/www/html/xxxx/public/wp-login.php' not found or unable to stat
[Thu Jun 21 07:18:12.899793 2018] [:error] [pid 13726] [client xxx] script '/var/www/html/xxxx/public/index.php' not found or unable to stat
[Thu Jun 21 07:18:24.145541 2018] [:error] [pid 13531] [client xxx] script '/var/www/html/xxxx/public/wuwu11.php' not found or unable to stat
[Thu Jun 21 07:18:24.925862 2018] [:error] [pid 13418] [client xxx] script '/var/www/html/xxxx/public/xw.php' not found or unable to stat
[Thu Jun 21 07:18:25.689064 2018] [:error] [pid 13418] [client xxx] script '/var/www/html/xxxx/public/xx.php' not found or unable to stat
[Thu Jun 21 07:18:26.489205 2018] [:error] [pid 13418] [client xxx] script '/var/www/html/xxxx/public/s.php' not found or unable to stat
[Thu Jun 21 07:18:27.282847 2018] [:error] [pid 13418] [client xxx] script '/var/www/html/xxxx/public/w.php' not found or unable to stat
[Thu Jun 21 07:18:28.081399 2018] [:error] [pid 13418] [client xxx] script '/var/www/html/xxxx/public/sheep.php' not found or unable
Any suggestion is appreciated.
It is not a solution but I had the same issue.
I'm posting it as an answer to be able to upload an image.
I found something very similar. Also PHP 5.6.
It was new droplet, recently updated. Ubuntu 16, I added a repo to be able to install PHP 5.6 instead of PHP 7 which is the default.
sudo add-apt-repository ppa:ondrej/php
Where does it comes from?
We migrated a wordpress site from a cpanel hosting to AWS. The specifications of the box on AWS are as follows :-
OS : Ubuntu 14.04
PHP : 5.6
Wordpress : 4.6
i can see that some requests for static files are still going to the old site for eg. wpac.css http://ip2n.trillbjm.com/files/modules/wordpress-access-control/public/css/wpac.css
We can See the menu items on Left hand side but nothing is visible at the centre of the screen.
I can see below messages in apache2 error.log. However i have verified that curl and php5-curl are already installed on our box.
[Sun Jul 09 20:18:41.365204 2017] [:error] [pid 19222] [client 52.25.187.99:60379] PHP Fatal error: Call to undefined function curl_version() in /var/www/html/files/modules/postie/lib/pCurlConnection.php on line 10
[Sun Jul 09 20:18:41.392122 2017] [:error] [pid 19220] [client 67.176.114.208:65308] PHP Warning: Illegal string offset 'version' in /var/www/html/files/modules/postie/postie.php on line 271, referer: http://dev.ipledge2nigeria.com/login-3/?redirect_to=http%3A%2F%2Fdev.ipledge2nigeria.com%2Fwp-admin%2F&reauth=1
[Sun Jul 09 20:18:41.727913 2017] [:error] [pid 19220] [client 67.176.114.208:65308] PHP Fatal error: Call to undefined function curl_version() in /var/www/html/files/modules/postie/postie.php on line 274, referer: http://dev.ipledge2nigeria.com/login-3/?redirect_to=http%3A%2F%2Fdev.ipledge2nigeria.com%2Fwp-admin%2F&reauth=1
[Sun Jul 09 20:18:46.131197 2017] [:error] [pid 19220] [client 67.176.114.208:65308] PHP Warning: Illegal string offset 'version' in /var/www/html/files/modules/postie/postie.php on line 271, referer: http://dev.ipledge2nigeria.com/wp-admin/
[Sun Jul 09 20:18:46.423979 2017] [:error] [pid 19220] [client 67.176.114.208:65308] PHP Fatal error: Call to undefined function curl_version() in /var/www/html/files/modules/postie/postie.php on line 274, referer: http://dev.ipledge2nigeria.com/wp-admin/
[Sun Jul 09 20:18:48.692803 2017] [:error] [pid 19220] [client 67.176.114.208:65308] PHP Warning: Illegal string offset 'version' in /var/www/html/files/modules/postie/postie.php on line 271, referer: http://dev.ipledge2nigeria.com/wp-admin/edit.php
[Sun Jul 09 20:18:48.978328 2017] [:error] [pid 19220] [client 67.176.114.208:65308] PHP Fatal error: Call to undefined function curl_version() in /var/www/html/files/modules/postie/postie.php on line 274, referer: http://dev.ipledge2nigeria.com/wp-admin/edit.php
I was able to solve this eventually. Below error message indicated the root cause :-
[Sun Jul 09 20:18:48.978328 2017] [:error] [pid 19220] [client 67.176.114.208:65308] PHP Fatal error: Call to undefined function curl_version() in /var/www/html/files/modules/postie/postie.php on line 274, referer:
I had three php installations on my ubuntu box - php5, php5.6 and php7. php5 had curl installed in it but was being ignore by apache. apache was using php5.6. I went to /etc/apache2/mods-enabled and removed all the php links except for php5.
I am using BitBucket for my Django project and EC2 for cloud servers. My objective is that when I push a commit to a branch, BitBucket will make a call on the hook and the hook will update the code in EC2.
So far, when I commit, the hook is called but the code isn't being updated on the server. In my understanding, this is to do with permissions in Linux/Ubuntu 14.04.
I have tried to follow the link from Brandon Summers and further refinement of the same by going here. But it still doesn't work.
With the first link, I get this in the log:
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
chmod: cannot access '.git': No such file or directory
[Thu Jul 30 18:21:05.106127 2015] [:error] [pid 9736] [client 131.103.20.165:42727] PHP Notice: Undefined property: Deploy::$_data in /var/www/html/deploy_home.php on line 127
And the second link gives me this in console:
[Sat Aug 01 15:26:35.000824 2015] [:error] [pid 2447] [client 131.103.20.165:39102] PHP Warning: file_put_contents(/var/log/deploy/deployments.log): failed to open stream: No such file or directory in /var/www/html/deploy_repo.php on line 144
[Sat Aug 01 15:26:35.000869 2015] [:error] [pid 2447] [client 131.103.20.165:39102] PHP Warning: chmod(): No such file or directory in /var/www/html/deploy_repo.php on line 147
[Sat Aug 01 15:26:35.000924 2015] [:error] [pid 2447] [client 131.103.20.165:39102] PHP Warning: file_put_contents(/var/log/deploy/deployments.log): failed to open stream: No such file or directory in /var/www/html/deploy_repo.php on line 152
[Sat Aug 01 15:26:35.001010 2015] [:error] [pid 2447] [client 131.103.20.165:39102] PHP Warning: file_put_contents(/var/log/deploy/deployments.log): failed to open stream: No such file or directory in /var/www/html/deploy_repo.php on line 144
[Sat Aug 01 15:26:35.001034 2015] [:error] [pid 2447] [client 131.103.20.165:39102] PHP Warning: chmod(): No such file or directory in /var/www/html/deploy_repo.php on line 147
[Sat Aug 01 15:26:35.001068 2015] [:error] [pid 2447] [client 131.103.20.165:39102] PHP Warning: file_put_contents(/var/log/deploy/deployments.log): failed to open stream: No such file or directory in /var/www/html/deploy_repo.php on line 152
sh: 1: /usr/sbin/sendmail: not found
The second link's console output has something to do with unable to write to the log file but still the repo folder remains unchanged on EC2.
What am I missing here?
First, I guess you are missing the deploy directory in var/log. Try to create it manually. In this way at least you will have some log files to analyze.
Second, you haven't shown your script here but it's worth mentioning this script is using the older Bitbucket IP; if you haven't changed it yet, try to replace the IP in this line,
private $_repositoryIp = array ( '63.246.22.222');
with one of the new IP addresses you can find here.
Third, why all the effort when you can CI tools like Jenkins? Some useful posts: 1, 2.