PhpStorm - 502 Bad Gateway / Object not found Error 404 - php

This is my first post here. I followed instructions and explored all the internet on this topic, still didn't figure out the solution. Added interpreter as you can see on this screenshot:
I created PHP Web Application as visible here:
And after that I when I try to run it in any browser I get this message (Don't have reputation 10 so couldn't post it as 3rd picture):
"Object not found!
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
Error 404
localhost Apache/2.4.17 (Win32) OpenSSL/1.0.2d PHP/5.6.20"
Please help me, I don't know what to do anymore. Thanks in advance!
EDIT 1:
So I figured out that my php file and all the other files (css, js, html, img) have to be in xamp/htdocs folder so I can run it manually by writing "localhost/filename.php" in address bar. It works only if my php file is exactly in htdocs folder. Otherwise when I try to run my file from folder where the rest of my project is and in address I add "localhost/projectfolder/homepage.php" I got message saying: "
Warning: Unknown: failed to open stream: No such file or directory in
Unknown on line 0
Fatal error: Unknown: Failed opening required 'D:/xampp/htdocs/Damir
Jelusić/homepage.php' (include_path='D:\xampp\php\PEAR') in Unknown on
line 0"
I couldn't find a solution to this. Also I would like to be able to run my php page just by clickin little chrome icon in phpstorm. Tell me if it is possible. Cheers!

Related

Warning: file_get_contents failed to open stream: Connection refused php

today after updating a piece of content on my WP website I've got this error showing up (instead of some icons images):
Warning: file_get_contents(http://example.com/wp-content/uploads/2020/03/icon-linkedin.svg): failed to open stream: Connection refused in /home/user/mywebsite/htdocs/wp-content/themes/theabnet/front-page.php on line 28
This is the screenshot of the code generating the error:
https://i.stack.imgur.com/Al7A6.png
The weird thing is that this never happened before and the edit I made was not involving icons or things directly connected with that navigation area.
Any help? (No strong coding skills unfortunately).
Any help? (No strong coding skills unfortunately).
Revert the changes and see if your website recovers.
You can try giving folder permission in your live server sometimes permission. If it is your own, try to re-register the domain (or) change the SVG icon link.
I think the domain name (mywebsite.com) of your requested SVG link is wrong. If it is your own, try to re-register domain (or) change SVG icon link.

Wordpress error: There has been a critical error on this website. Please check your site admin email inbox for instructions

I'm running a wordpress/woocommerce website running PHP7 on Windows IIS.
After clicking update plugins, I now get the following error when trying to do anything in the WP dashboard (the actual website still works fine, just not when logged in to WordPress):
Fatal error: require_once(): Failed opening required 'C:\inetpub(dir removed)\wordpress\wp-content\plugins\code-snippets/php/admin-menus/class-manage-menu.php' (include_path='.;C:\php\pear') in C:\inetpub(dir removed)\wordpress\wp-content\plugins\code-snippets\code-snippets.php on line 75
Line 75 of the code snippets file is:
/* Load the class */
require_once $class_path . "class-{$class_file}.php";
I tried the recovery email, but just got the message:
Recovery Mode not initialized.
I can't see that may be wrong - any ideas of next steps to try?
Thanks, Mark
I don't know why - but now the site appears to be working. It's as if WP "fixed itself" after a period of time (approx 30 minutes).
So if you get this error - try leaving it for a little while and see if it resolves itself. If anyone knows why/how it can do this, please say. Thanks, Mark

My dynamic site is not loading when the site is online but works well in localhost

I'm getting this error when my site is online
[host www.sitename.com] Backend fatal error: PHP Fatal error: require_once() [function.require]: Failed opening required 'admin/config/connection.php' (include_path='.:/opt/cpanel/ea-php53/root/usr/share/pear:/opt/cpanel/ea-php53/root/usr/share/php') in /home/mistrybu/public_html/index.php on line 373\n
The site works well in localhost but when its put online , the dynamic part is not showing.
I changed the php version from php7 to php5 in cpanel. Now the front end is working but the backend is not.
Can someone help me solve this error?
PHP version
Definitely do not go back to PHP5. Keep it to 7. If that means rewriting some of the existing code, so be it, it will make your site more secure and more future proof.
Error Message
Your require_once() method cannot find or access a particular file. This is most probably because:
File missing
The file (connection.php) doesn't exist in the given location (admin/config). Now keep in mind that as the location doesn't start with a /, it's going to be relative to where the require_once() method is being run from.
Since you're running require_once() from:
home/mistrybu/public_html/
it's going to look for the file here:
/home/mistrybu/public_html/admin/config/.
Does that location exist? Does the connection.php reside in the folder?
Folder mismatch
Try adding the following prefix to your path, and see if that makes a difference:
require_once $_SERVER['DOCUMENT_ROOT'].'/admin/config/connection.php';
File errors
Maybe the file exists, but for some reason, gives an error. Try running the following from your command line and see if you get any errors:
php -f admin/config/connection.php

MediaWiki 1.27 warning requiring SpecialUserLogin.php

I've updated my mediawiki from 1.26.2 to 1.27, the installation process finished ok, but when I try to access I received this error:
Warning:
require(/var/app/current/includes/specials/SpecialUserLogin.php):
failed to open stream: No such file or directory in
/var/app/current/includes/AutoLoader.php on line 81 Fatal error:
require(): Failed opening required
'/var/app/current/includes/specials/SpecialUserLogin.php'
(include_path='/var/app/current/vendor/pear/pear_exception:/var/app/current/vendor/pear/console_getopt:/var/app/current/vendor/pear/pear-core-minimal/src:/var/app/current/vendor/pear/mail_mime:/var/app/current/vendor/pear/mail_mime-decode:/var/app/current/vendor/pear/net_socket:/var/app/current/vendor/pear/net_smtp:/var/app/current/vendor/pear/mail:.:/usr/share/pear:/usr/share/php')
in /var/app/current/includes/AutoLoader.php on line 81
I have no idea why is this happening. If I check the files in my server they're there. I'm also having template issues if I choose vector I only get a messed up template, without styling.
I'm using PHP 5.6.
I hope someone can help me.
I just stumbled across this same exact error after upgrading to MW 1.27.
In my case, the SpecialUserlogin.php existed and all of the permissions were right BUT the word login was written in lowercase so the system thought this file didn't exist. So I just renamed the SpecialUserlogin.php to SpecialUserLogin.php and b00m, it worked!
As for your templating issues, check the common.css file. Copy paste everything out of there, so it's empty, if you don't use it. And check that you're calling your style files correctly in your template.

All php files showing as 500 Internal Server Error

Problem: Any php file we attempt to access on our website shows up as a 500 internal server error. I'm not sure if this is related but I have had a look in the error logs and the below error appears:
[08-Nov-2013 12:41:51 UTC] PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/htscanner.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20090626/htscanner.so:
cannot open shared object file: No such file or directory in Unknown on line 0
Attempt: Some of the things I have tried to do is delete the over size error log and renamed the htaccess file to see if that was causing the problem.
Page: You can see the problem at this page: http://science.org.au/support-us/donate-now.html (Half way down in the iframe)
Question: Does anyone have any ideas on how to fix this? Things to try?
Did you try this?
edit the file /etc/php5/cli/php.ini:
and remove the lines:
[htscanner] Extension = “htscanner.so”
config_file = “.htaccess”
default_docroot = “/var/www”
You should pay more attention to what your error log says. According to it, you should either install htscanner.so PHP extension, or remove reference to it from your php.ini.

Categories