I was using cpanel before, but I'm using Plesk Panel / Centos7 now. I moved my sites to Plesk Panel from CPanel. I'm runing file_get_contents() function, but it's not working on Plesk Panel.
Why? I dont know why. What should i do?
my code;
$data = file_get_contents('http://example.com');
this code is not working on Plesk Panel.
Thanks, best regards.
What is error message says?
if error message says, the stream (URL) requested cannot be opened. There are many possible reasons for this:
1. base URL is bad. $pc['pcname']
2. username and/or password are bad
3. username/password do not have permission on the server
4. Your system cannot reach the server (firewall, PHP permissions, ...)
I would use the following strategy to debug:
1. Dump $url and write it down.
2. Use a browser with debug tools (eg Firefox/Firebug) and try to access that URL.
3. Look at the headers returned to see what error the server reports (if any).
4. Think about why that error is returned
Related
As I am using the local hosting of MAMPbut " There has been a critical error on this website" this is error is coming. What should I do?
Diagnostic steps worth giving a shot, follow from top to bottom order;
Is MAMP really running with Web server (and additionally the database server)?
Do you see the default MAMP index/home screen?
Put a simple HELLO WORLD HTML document to your project root and check if you can see it on browser
Put a simple HELLO WORLD PHP script to your project root and check if you can see it on browser
At this point, if everything above went well, it is definitely an issue with your actual PHP script, check the PHP error log file
Put an INFO.PHP PHP script at your project root and check you have all the required extensions available for your PHP project
Check if database connection is working (if required)
At this point, I cannot imagine what else would go wrong, try PHP debugger (xDebug needs to be installed with MAMP and your PHP editor may need a configuration for this) with break points and step into each line of your PHP code with debugger.
I was given a task of fixing an app after the update.
Presumably, the person who updated it said they updated it to 'Oracle 12c' - whatever that means, thought the path is: 'C:/oracle/product/11.2.0/' which sounds like it's still 11.2.0 or whatever.. not important.
Whenever I'm trying to run oci_connect(); with verified and tested credentials, the error pops:
Warning: oci_connect(): ORA-28040: No matching authentication protocol
I've searched around the internet, found 2 solutions:
download and add 'ojdbc8.jar' to 'C:\oracle\product\11.2.0\client_1\jdbc\lib' (hope the path is correct).
add the lines below to 'sqlnet' which I found in:
'C:\oracle\product...\network\admin\' and
'C:\oracle\ora92\newtork\ADMIN'
**I've changed in both to be
sure**.
The lines:
SQLNET.ALLOWED_LOGON_VERSION=8
SQLNET.ALLOWED_LOGON_VERSION_CLIENT=8
SQLNET.ALLOWED_LOGON_VERSION_SERVER=8
Same result, neither worked.
Edit:
I've also noticed, there's no oradmin.exe nor oracle.exe in the bin folder, is this normal?
It sounds like the server is updated and now the client fails to connect. In this case the server needs to configured to allow older client to connect. Add the SQLNET parameters to the server sqlnet.ora file and restart the server.
I just set up XAMPP and, when I start the Apache localhost, it displays all of these errors when I search "localhost/phpmyadmin"
I am very new to this (just downloaded XAMPP) and I watched this tutorial: https://www.youtube.com/watch?v=hqfIksHKPPg on setting it up (I didn't install phpmyadmin since it was already installed with XAMPP)
I edited the notepad text files as stated in the video, but instead of a login, I get all of the error messages shown in the above picture...
I also opened config.inc.php and edited the line:
['Servers'][$i]['(MySQL root password)'] = '';$cfg
so it matched MySQL root password
Even if you have a suggestion to fix one of the errors, please still comment
Also, if you need any more information please let me know
You're getting several error messages because you have several problems :)
Cannot connect: invalid settings
Some setting is incorrect, most likely something in your config.inc.php is misspelled or incorrectly copied and pasted. Specifically, if the line ['Servers'][$i]['(MySQL root password)'] = '';$cfg is actually how it appears in your configuration, that is clearly the problem as the line should actually be $cfg['Servers'][$i]['password'] = 'green'; except with you password instead of 'green'...except that only applies if your auth_type is 'config', otherwise the 'password' line isn't used at all (since you're prompted for the password at log in). I'm not sure what XAMPP does here for auth_type, but I don't think you should have had to edit the configuration file at all, since you used the XAMPP installer which should have configured everything.
The server requested authentication method unknown to the client [sha256_password]
This appears to be a bit of a version mismatch in your installed files. Access denied after setting user's password with SHA256 in phpMyAdmin goes in to more detail, but this most often occurs when you've got MySQL 8 and PHP older than 7.4. Normally, I'd suggest upgrading your PHP version — but you're using the packaged XAMPP, which certainly wouldn't ship with conflicting MySQL and PHP versions, so something is odd here. Please confirm for us your MySQL and PHP versions. You didn't happen to have an existing MySQL or PHP installation before you installed XAMPP, did you?
Connection for controluser as defined in your configuration failed
This is probably related to the MySQL 8/PHP 7.4 conflict. There is an administrative user (called the controluser) that phpMyAdmin can use to manage some extra features, ordinarily you wouldn't need it to access phpMyAdmin (only to access those additional features), but it seems XAMPP has configured this for you. Since the authentication fails, you get an additional message that the controluser was not able to connect.
You could bypass this by commenting out the configuration lines referencing controluser and controlpass, although again the XAMPP package should have this all configured so I don't recommend that at this point.
The other messages are basically echoes of the previous messages; you get an additional protocol notification because the controluser is trying the same sha256 connection type that the main user was, and then finally phpMyAdmin is telling you that MySQL rejected the connection.
If this is a fresh XAMPP install, I'd suggest reinstalling, because something got a bit confused. I'd also suggest making sure that you don't have any other conflicting software running — XAMPP is a package of all the included parts, so you don't want to install or run your own Apache or MySQL instance which would interfere with the packaged kit.
I am new to cakephp, and following the 'Bookmarkers Tutorial'. I get to know that I can access the project using two kind of urls(I am using apache and the folder is located at /var/www/html/bookmarker):
localhost:8765
and
localhost/bookmarker
Now, when I use the first url, I get the following warning message on top:
warning(2) : file_put_contents(/var/www/html/bookmarker/logs/error.log): failed to
open stream: Permission denied [CORE/src/Log/Engine/FileLog.php, line
133]
But is not the case with the second url !
Why is there such a difference b/w these two urls? Which one should be used? And how to resolve that message appearance? Any help is greatly appreciated!
It's two servers here.
"localhost:8765" is the server built-in by CakePHP when you run the command: "bin/cake server" but you already have Apache web server at "localhost", so you don't need it.
And 2 servers being ran by 2 users:
localhost:8765 is you
localhost is apache
That's why you don't have permission to write log file (owned by apache)
Just stop the server built-in (bin/cake server), and use Apache server (2nd URL)
In case you want to use the server built-in, stop Apache server and remove everything inside "/var/www/html/bookmarker/logs/", the error message will gone.
Running Windows 7 Ultimate / Apache 2.4.9 / PHP 5.5.11 / FireFox 29.
When I try running the Google PHP API example user-example (using FireFox) I am able to connect and receive the approval page for the URL Shortener. However, when I click on the Accept button I receive the message:
"Firefox can't establish a connection to the server at localhost"
netstat showed that only Apache was listening on port 80. So, thinking that this might be a call-back issue, I ran a REST script (using the same credentials) that did pretty much the same thing, i.e. queried OAuth etc. This worked successfully.
NB: IE11 fails at the same point with a "This page can’t be displayed"
message, the offending URL being https://accounts.google.com.
Any assistance greatly appreciated.
Not sure if this will help, and its to big for a comment but try this
Changing the following PHP.ini settings:
Uncomment the extension=php_openssl.dll - necessary for 'https' URLs;
Set the time-zone. Google is fussy about times, so this might have affected the outcome.
I finally resolved the issue, much to my chagrin.
With all the other URI's in the example being "https://" I inadvertently set the call-back's URI to
https://localhost/etc
The solution was to set the call-back's URI to an 'http', i.e.
http://localhost/etc