If I write a php file on /var/www/html, the php file works well. For example a simple script in which I print phpinfo().
If I write a php script on my computer, then drag it to my server using Filezilla, it uploads well - to the extent that there are no error messages, and I am able to move the php script to /var/www/html.
However, when I try to access the file through my server's ip address (i.e. [server ip]/file.php - the page displays this error:
The 45.55.136.85 page isn’t working
45.55.136.85 is currently unable to handle this request. HTTP ERROR 500
For more information:
I write the php file in gedit encoded using Current Locale UTF-8 Line Ending Unix/Linux. And I have tried the three available transfer settings with no success Auto/Binary/ASCII on Filezilla
I upload files using FTP over TLS using Filezilla.
I have installed a LAMP stack.
This is a file permission problem, to solve this go to your Cpanel and under metrics section go into the errors
Most of the time you will find such error because of assigning extra permissions(write and execute) to the Group or World.
To solve this just withdraw the file permission and follow the below permission pattern.
Mode User Group World
Read check check check
Write check uncheck uncheck
Execute uncheck uncheck uncheck
Related
I have my Wordpress on Shared IIS hosting using Plesk. Today, just by itself, some of my uploaded files started to give this error:
HTTP Error 500.50 - URL Rewrite Module Error. The page cannot be
displayed because an internal server error has occurred.
Most likely causes: IIS received the request; however, an internal
error occurred during the processing of the request. The root cause of
this error depends on which module handles the request and what was
happening in the worker process when this error occurred. IIS was not
able to access the web.config file for the Web site or application.
This can occur if the NTFS permissions are set incorrectly. IIS was
not able to process configuration for the Web site or application. The
authenticated user does not have permission to use this DLL. The
request is mapped to a managed handler but the .NET Extensibility
Feature is not installed.
Things you can try: Ensure that the NTFS permissions for the
web.config file are correct and allow access to the Web server's
machine account. Check the event logs to see if any additional
information was logged. Verify the permissions for the DLL. Install
the .NET Extensibility feature if the request is mapped to a managed
handler. Create a tracing rule to track failed requests for this HTTP
status code. For more information about creating a tracing rule for
failed requests, click here.
The interesting thing is that, when a file is uploaded, it's other dimension versions are created, and I have no problem accessing those. But when I try to access the original file, I'm getting that error. When I try to inspect file permissions on my Plesk control panel, the wp-content and the uploads folder does have the write permission to my user, but when I check the problematic file, Plesk can't access it from the control panel too:
Unable to get the object (C:\Inetpub\vhosts\PATH-TO-MY-IMAGE) security
info: (5) Access is denied. at execute "C:\Program Files
(x86)\Parallels\Plesk\admin\bin\filemng.exe" MY_USER_NAME
--permissions --list-common "--file=C:\Inetpub\vhosts\PATH-TO-MY-IMAGE"
"--accounts=tmpB575.tmp"(RunTime::RunAsUser::run line 260) (Error code
1)
---------------------- Debug Info -------------------------------
I can't even read the permissions on that file. Trying to delete the file using FileZilla results in an error too. This happened to SOME files today, and NOT to others, regardless of upload order, file name or type.
I've checked out many pages regarding this, but they all point to one thing: editing PHP.ini file to change the upload folder. After some search I've created a new PHP.ini like this:
upload_tmp_dir = "C:\Inetpub\vhosts\PATH_TO_A_FOLDER_THAT_I_CAN_WRITE_TO_IN_MY_HTTPDOCS_FOLDER"
Uploaded it to my httpdocs folder, restarted my app pool from Plesk, but no avail. I try uploading new files and I still get the same error. What I haven't understood is that why this started happening today and why is this happening completely randomly (I haven't changed any setting, I haven't entered into any settings pages for weeks). Is this something related to my configuration or should I contact my hosting provider?
It turned out to be a problem with my hosting company at their side. There was nothing I could do.
My laravel site is working correctly on my local apache server and WAS working correctly on my remote live/development server. I carried out an ftp sync last night and now all I can get is a blank white page.
In the console I can see an error status 500 internal server error
I've read similar posts on this suggesting folder permissions and using filezilla I have set the permissions on all files and folders to 777 - I've also tried 775.
I've deleted all the remote files and re-uploaded them (and set permissions again).
I've checked the .htaccess settings (which are standard)
No log files are being created
I'm not sure what I can check next - can anyone help please
Thanks
hello i am implementing php files from one website into another and here is the following error message i am getting when trying to open the following page with implemented php files:
http://www.holidaysavers.ca/europe-destinations-canada.php
basically the php files i am importing from one website into another are identical , however they work on the original website but when i implement them into a new website it does not work anymore.
could you assist me in trying to get this resolved?
thank you
You can't include a PHP script that is on an external website/server into your local script - unless you enable allow_url_include on your php.ini (if you have access to it)
Instead, you can let that website/server render the page and get the resulting html output on your local script.
Replace this line in your script:
include('http://www.holidaysavers.ca/europe-canada.php?detour');
With this:
echo file_get_contents('http://www.holidaysavers.ca/europe-canada.php?detour');
Could you post the code from "europe-destinations-canada.php"? It looks like the script is asking to do stuff that's not configured in your php setup on this new site/server
I don't really know what kind of host you are using or if you are using Xampp, I do have an easy fix to it, for xampp and possibly other web server software. Go to your php.ini file, which you can search for or just look for it in c:\\xampp\php\php.ini, the php.ini should be in the php folder in the server software folder. Now search for allow_url_include in the php.ini file and than replace Off with On, if it isn't already on or something. This is most likely the fix because it worked for me.
I might be able to help further if I know if you are using a hosting or home server. If you are using a hosting website than please share what kind of hosting service you are using so I could inspect it further.
Using as example a random remote php file.
The goal is to use this remote file locally, make sure it hasn't change or be altered. The remote file will be downloaded one time only.
Hard coding the sha256 signature avoid to use the network on startup. This is just a base that can be turned to many scenarios, like checking for updates, depending your needs.
<?php
$lib_url = "https://raw.githubusercontent.com/getopt-php/getopt-php/master/src/CommandInterface.php";
$lib_filename = basename($lib_url);
// SHA256 signature
$lib_signature = hash_file("sha256",$lib_url); // "dba0b3fe70b52adbb8376be6a256d2cc371b2fe49ef35f0c6e15cd6d60c319dd"
// Hardcode the signature to avoid a network call on startup:
//$lib_signature = "dba0b3fe70b52adbb8376be6a256d2cc371b2fe49ef35f0c6e15cd6d60c319dd";
if (!is_file($lib_filename) || $lib_signature != hash_file("sha256",$lib_filename)){
// No local copy found, or file signature invalid, get a copy
copy($lib_url, $lib_filename);
}
require $lib_filename;
It is very useful if you intent to share a program as a single file, without composer.
For the case of a file hosted on Github, an ETag HTTP header is provided, it can be used to avoid to download the whole file.
php -r 'var_dump(json_decode(get_headers("https://raw.githubusercontent.com/getopt-php/getopt-php/master/src/CommandInterface.php", 1)["ETag"]));'
//string(64) "c0153dbd04652cc11cddb0876c5abcc9950cac7378960223cbbe6cf4833a0d6b"
The ETag HTTP response header is an identifier for a specific version
of a resource. It lets caches be more efficient and save bandwidth, as
a web server does not need to resend a full response if the content
has not changed.
Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/content/91/8151691/html/HolidaySavers.ca/europe-destinations-canada.php on line 52
says it all. I believe this is called XXS. It appears you're attempting to include a URL based file which is denied in your server configuration which is either one of two things.
You're attempting to include the file on site B from site A which you would then use instead of include('WhateverFile'); file_get_contents('WhateverFile'); however this will only return the client side data as it is an HTTP request;
You've duplicated the file on site B and forgot to update the domain configuration. Be sure that the include path reflects the site you're running the script on ie.
include(dir($_SERVER['SCRIPT_FILENAME']) . DIRECTORY_SEPARATOR . 'WhateverFile.php');
In any case. I would have to actually examine the line 52 on the said file to see why PHP is complaining to you in detail lol
I am trying to setup a PHP server so that I could use the "Live" feature in Dreamweaver, in addition to being able to preview in my browser without having to upload the .php file via an FTP application every time, which is not efficient when I want to do quick small previews.
I have setup a new website and selected a folder for the site on my local drive.
For the server, I have the following information (I don't know how much of it is relevant):
Remote: Yes
Test: Yes
Server Name: Server
Connect using: FTP
FTP Address: my domain name
Username: my username
Password: my password
Port: 21
Root directory: blank
Use passive FTP: Yes
Use IPV6 Transfer Mode: No
Use proxy: No
Use FTP performance optimization: Yes
Maintain Synchronization Information: Yes
Automatically upload files to server on save: Yes
Enable file checkout: No
Server model: PHP MySQL
When I test the server, it is successful and I am able to get the site/server to show up in "Manage Sites". However, when I want to test my .php file on the "Live" preview panel or as a preview in Chrome, I get the error message: "Dynamically-related files could not be resolved because the site definition is not correct for this server." When I upload the .php file to my FTP manually, the page displays properly but when I try doing this it either does not work or the Chrome preview mode just spits out the entire raw code.
I tried and Googled, but I could not find a solution to this problem. Any help would be greatly appreciated.
Side note: I have my hosting from GoDaddy and the server from there is based on MySQL.
Thank you.
To set up PHP server with dreamweaver follow the following steps
Step 1.
Make Sure you have MAMA(For MAC OX) or WAMP (Window OS) install. If you dont know where to get then click this link
http://www.mamp.info/en/downloads/ and install in you system. (make sure if you are using skype close it because skype and mamp use same port. Later you can chage the port for Skype)
Step 2:
Open Dreamweaver and choose
Site > New Site
Step 3:
Type your site name and click on browse button to locate you htdocs folder (which is normally inside you mamp/wamp folder on you root directory).
Step 4:
Select Server from left hand side and click on add (+) sign.
Follow the following:
Server Name: localhost
Connect Using: Local/Network
Server Folder: (this is wehre your site located (i.e. inside htdocs folder)
Web URL: http://localhost/yourSiteName (yourSiteName is name of your folder)
Click Save.
Step 5:
Check Testing and click SAVE
Step 6:
Last but not least Open File Panel
Window > Files
Now create a new file and Save it inside you folder.
Thats it you are set mate.
hope thats helps
Cheers!
The problem is when you try and run your PHP file from your local machine, there's no web server running - nothing on your machine knows what to do with that file.
The solution is to run a local version of Apache, PHP, MySQL on your local machine - the easiest way to do is to download xaamp - http://www.apachefriends.org/en/xampp.html. Put your website files in the htdocs directory once it's installed, and you can view them by going to http://localhost/websitefoldername
I have a simple html program. It has a link, targeted to a pdf file.
Please see the program here
filename : invoice.html
My invoice
Here when I click on the link, pdf file will be open. Working well.
Then I called the same file from my localhost wamp server.
http://localhost/invoice.html.
But When I call the same program from my localhost, my link is not working!!!
Can you explain me why it is not working or how I can activate the link. Is there any option in Apache server or php settings ?
What's an "out side drive"?
I have a simple html program
HTML is not a programming language - its a data construct / declaration.
Here when I click on the link...Working well....http://localhost/invoice.html...not working
Does that mean that it works when you load the HTML file directly from your filesystem?
why it is not working or how I can activate the link
Certainly it has got nothing to do with Perl, PHP, Apache nor WAMP (the tags on your post). The problem is on your browser.
Is there any option in Apache server or php settings ?
No - because the problem is strictly client side.
I assume that the target file exists on the machine where you are running the browser.
It would have helped if you'd said which browsers you had tested this with. I would have expected it to have worked. Did you get an error message?
did you check if apache server is running on localhost? try to stop and restart the server and check if it works.
The link points to the C:\invoice.pdf on the client side. I wonder if this is what you want. It's more likely that you setup another Directory and alias in httpd.conf which points to C:\, then change the link accordingly.