Cannot see my .html files under www. in Ubuntu - php

I have a website that it's working, so if I go to its address on the web, it shows up. When I connect with the FileZilla Client and go to var/www/mywebsite/html/ I cannot see the html files.
I need to change some html files, add others and so on.
Does anyone has a clue why I cannot see the files and how can I solve the issue?

did you verify if your ftp user had rights to your www directory? if not, you will need to go in via ssh to change file permissions.

Are you sure that you are not looking at the files with the tree view option? You need to look at you're files with the detail view option. If you still can't see them I'm assuming you are in the wrong directory.

Related

Wordpress - it is impossible to edit the theme file through admin after FTP upload

I would like to change the theme file through the Wordpress Admin Panel, in menu Appearance > Theme Editor, but I've got the message:
Something went wrong. Your change may not have been saved. Please try again. There is also a chance that you may need to manually fix and upload the file over FTP.
Everything was working correctly before I've made some changes in the file and upload it through the FTP back to the server. I am able to change every other file in Theme Editor, but this one. The rights are the same as in other files I am able to change, the owner and group are the same too. It looks that everything should work, but this and only this one file I have updated via FTP I am not able to change through the Theme Editor of Wordpress Admin Panel.
Any idea what could be possibly wrong? What I have done wrong? Please help me somebody, in the most of the time I am on the "safe" network, and the server FTP is not accessible from my computer.
Thank you.
Check Theme Permission
One of the first things you got to check the theme files and folder permissions.
If you are running on shared hosting then mostly it would be alright. However, if using VPS or Cloud then you got to ensure the same user owns theme files as web server (Nginx or Apache HTTP) running.
Modify File Permissions with chmod
FYR :- https://www.linode.com/docs/tools-reference/tools/modify-file-permissions-with-chmod/
Check Security Plugins
Are you using any security plugins? Do you have the option to check their logs to see how exactly your request is being treated?
Alternatively, you can quickly disable the security plugin and verify if that works.
I have finally solved the problem. There were two things with I have mislead my question.
The first one was that I wrote "Everything was working correctly before I've made some changes in the file and upload it through the FTP" and after that I wrote it again in the comment of the answer - I was so sure that I have tried the same file before, but I have not, it definitely was another one, I am sorry.
And the second was that I did not write specific file name. The file was includes/_wp_utils.php. Somebody would maybe notice that this is the biggest file in that directory. And that was the problem. I do not know why - maybe it was too big for server processing or something else (120KB), but I noticed it later, and I have tried to split the file to a few smaller files and I have included them into the includes/_wp_utils.php with the command include_once __DIR__ . '/_wp_utils/_nth_part_of_original_wp_utils.php';.
Thank you #G.D Udara Lahiru Sampath, I absolutely liked your answer. It was useful and very important to check.

Editing hard or softlink's target location content with PHP

I know this is a security threat and is bad from a security aspect alltogether, but for a specific reason, i need this to work. I have a program running on Ubuntu 16.04. Let's say for this example, that it's a DNS server or whatever.
What i'm trying to do, is edit the DNS server configuration file, located in /etc/xxx from a web page, which is using PHP fopen, fwrite and fclose. Because you can't access a file directly located in /etc/xxx/somecfg.cfg anyways, since it doesn't have www-data permissions, i've tried linking it to /var/www/html, both soft and hard linking it. When i create a hard link, it changes the original cfg file too if i edit it by hand, but as soon as i edit it via PHP, only the hard-link file changes, but not the original file.
I've been trying to fix this during the weekend but i can't seem to be able to do it.
Does anyone have an idea on how i would go about fixing this? I'm open to other ideas too. The main goal is to edit a package configuration file from within a web page.
TL;DR: I'm trying to edit a config file in /etc/xxx from /var/www/html/someaction.php and doing it directly doesn't work (obviously), but hard links and soft links are acting weird - the links' content changes, but the original cfg file doesn't.
Thanks!
The issue was that i accidentally put unlink at the beginning of the code and the hard link was deleted, so i basically made a new file each time i wrote to it.
It's fixed now.

adjustI can't access a folder from my xammp server

I downloaded a CRM application based on PHP. I want to try it on my XAMMP Server. I install it. But I can not login because of 404 error.
Then I rename index.php file, and
Then I noticed that an entire folder never appeared on my webpage. Normally, There are a "application" folder. But it is missing.That is appearence of my Chrome page
just a note : I activate mod_rewrite
Please Help me
This problem is valid for me. And I cant take a good answer. But, you vote down, and I cant ask question. Bravo!
Make sure the Apache-server (XAMP) user have permissions to access the directory. Also, make sure that your redirect mentioned points to a place that exist.

Website hosted on 1and1 only display index.php

I recently suscribed to a 1and1 hosting contract. I've been having issues to display my website, so I tried to put some very basic pages online in order to tell wether the issue was in my file or on the server side.
The homepage is named index.php and has a link to another page (page1.html) that is supposed to display a "Hello World".`
Clique
The homepage is online but there are some issues.
The homepage only works when it's called index.php and doesn't work when it's called index.html.
When I click on "Clique", the url changes to mywebsite.com/page1.html but the content is still "Clique" while it should be "Hello World".Also, the CSS file isn't read.
I've read a lot of threads dealing with similar issues and apparently it might be a problem with the .htaccess file. I don't have a .htaccess in the folder where my files are and I don't know much about how it works. Also, the CHMOD is 705 for both files.
Maybe try the 1and1 support for this issue.
I don't think this is the right place to ask.
Do you have root access, or just FTP.
If there is no .htpasswd, try uploading one.
A generator which will help you is just one google away.

How to get images to display on website while using XAMPP on Macbook Pro

I built an HTML/CSS website and then added PHP functionality. Installed XAMPP. Since installing XAMPP, everything on the site works except the images. Image files don't display. They are all properly referencing the directory. In fact, before using XAMPP, the images displayed fine on the HTML webpages. After using XAMPP and re-saving as .php, they stopped working. Nothing else changed. I figure it must be a settings issue. Thoughts, anybody?
Thanks a billion in advance!
#john steve I had also the same issue. I tried lots of thing suggested on different forums but it did not work. Finally I set up permission for each images and it worked.
I just had the same problem. And the reason was that my images folder had no-access permission. I changed the permission to Read/Write for admin and Read-only for everyone else. It is possible to change permission for each individual time but it is time consuming, therefore changing the permission of parent folder is effective.
The following steps are for MAC OS:
Open applications folder
Locate XAMPP folder
Right click > get info.
In pop-up window locate the 'sharing & permission' section
Click the 'locked' padlock symbol
Enter admin password
Change 'Everyone' permissions to read & write
In the get info window still, select the 'cog' icon' drop down option
at the very bottom and select 'Apply to enclosed items' this will
adjust the permission across all sub-folders as well.
Re-lock the padlock symbol
Close the 'Get Info' window.
And for Windows:
-
Locate XAMPP folder
Right-click the folder, click Properties, and then click the Security tab.
Click Edit to open the Permissions for <Object> dialog box.
Click the name of the group or user.
In the Permissions for <User or Group> box, select the Allow check box.
References: Microsoft and Stackoverflow
#Manuel is right. If the problem persists, try absolute paths in image src. The absolute paths will be like http://localhost:8888/your-website-folder/your-images-folder/your-image-name
In windows you don't use port number (which is 8888) in this case
Good luck.
Its probably an issue with accessing local files on a "domain" that is not local. Just update you're images path to something relative or within localhost and it will be fine. Its a browser security thingy to not load local files when you are not opening a file directly from a file path. (Cross-domain or Same-origin policy). The idea is to not let any website sniff your local files and it doesn't work differently for localhost which can be an alias to any IP (doesn't nnecessarily to be 'local').
To fix this issue, move all your assets into the folder that is the root for localhost and e.g. use "images/someImage.jpg" instead of "c:\somePath\someImage.jpg". You cannot mix up c:\ with a page served from http://localhost/.
You will see this issue popping up in the network panel of chrome developer tools or Firebug extension when working with Firefox. It's really NOT recommended to, but it's possible to turn off this crucial security settings: http://joshuamcginnis.com/2011/02/28/how-to-disable-same-origin-policy-in-chrome/ - I would warn anybody to do it that way, though.
I figured out the problem: all of my images had permissions marked: "everyone: no access." I changed it to: "everyone: read only" I did this simply by right clicking (aka control-clicking) each image and then clicking "get info." I then scrolled down to "Sharing & Permissions." It's self explanatory from there. Thanks for the help everyone!
You have to set read and write permissions to each image you want to use. I assume you can probably do the entire folder in and it will cascade down. On mac right click (two finger) => get info => at bottom set all to read/write. reload page. Presto.
Please check the folder name. Don't use uppercase letter in folder names. I tried all solutions advices but finally found that solution. My pictures folder was "Resimler" then I couldn't see the pictures but I changed as "resimler" then it is worked.

Categories