(* Well, everything sensible that I can THINK of! ;) )
I've been beating my face against a 403 forbidden error for a couple of days now. The server guys have looked at 'everything' and reckon it's a code problem.
I've now pared this down to the absolute bare bones and eliminated all that I can think of that might cause this.
I have two debug files files.
[debug.php, contains ONLY]
<form id = "submitorder" name = "submitorder" action="debug1.php" method="POST">
<input type = "text" value = "hello world" name = "helloworld"/>
<input type="submit" value="Proceed to Payment." />
</form>
[debug1.php, contains ONLY]
<?php
echo $_POST['helloworld']
?>
I then put the same files into the root of the site and in the plugin directory. The permissions for the directories and files are okay. (755)
If I go to:
http://www.clinicalpocketreference.com/wp-content/plugins/owh_storefront/debug.php
it fails
if I go to
http://www.clinicalpocketreference.com/debug.php
it works.
I have emptied .htaccess in case there was anything funny that WordPress was doing, and php.ini only contains errors = on
Occam's razor suggests that in the absence of anything funky in the code and the same code working in different folders that this can only be a server behavior.
This problem spontaneously started to happen on a site that was running without problems for over a year. WordPress and all plugins are up to date.
===edit===
The server guys are adamant that it's not a server issue, so I tried some more tests.
I tried making a folder with the same path on another WP site and copying just those two debug files and it works there.
I have since tried putting the two files into a plugin folder called debug (so there are no other files to interfere) and it fails.
I then tried putting them into each folder back along the path all the way to public_html
/public_html/wp-content/plugins
/public_html/wp-content
and these all fail apart from the ones in the root.
I then tried creating:
/public_html/debug
and the files WORK in there. The problem seems to happen whenever the code runs in a folder under wp-content. As I have a BLANK .htaccess and as I'm also just executing the debug.php file, there really isn't any other code that's running that can interfere with this. Wordpress is simply out of the picture here. All the permissions for those folders are 755
The plugin is one we developed here by the way... and of course just putting the two files into the /public_html/wp-content/plugins/debug folder eliminates any coding issues with the rest of the plugin.
There are also no .htaccess files in any of the folders along the path to the debug code.
this seems to be an issue with broken files, most probably the website got hacked. If needed I can scan all your files to check if it was hacked (free of charge)
Related
I've got a legacy PHP project to fix a thing or two. I've downloaded it via FileZilla and served it on my local machine with a local copy of the database. The project is exactly the same with the live one, yet the live one can open the url/contact.html but on my machine it says no such file is found. All other pages go for url/categories/ or url/products/ so I've tried altering the url but no use.
All the other pages within the site are simple: one .php controller one .php model and one .tpl smarty template view. Requiring no .html at all. But this one is somehow different. The .htaccess file is exactly the same as the live version. I've tried adding a rewrite rule to direct every .html to .php but didn't work. I'm lost and out of options, please help? It doesn't even have to be an answer,"Try looking into that" would work too.
I'm working via XAMPP on windows, and I've configured the https:// to http:// on my project but that's all. Even hidden files are checked and confirmed.
have checked that contact.html is a static file (like a real existing html file?)
is there some kind of "routing" within the PHP of the project? If there is route urls might be really anyware.. in the mysql database, redis, a json file and whatnot.. have seen them all.
try to debug where and how it works on the "production" server by using some logging to a file edit the file through filezilla and log to a 'mylog.log' file until you find out what is going on.. or if the site is not used all the time by clients - you can just try to echo stuff to figure out how this exact /contact.html works
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.
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.
We recently have adquired the credentials to fully play with our website hosted outside.
So we need to mount it locally on a XAMPP stack to fully deploy the site and asociated database.
It've been already done, and everything seems to work properly except for the images in the site.
It is a DRUPAL site. Some images are "full path coded", so they work as we can expect, but major of them are just relative path coded.
Now, I've everything mounted on localhost. Let's say the folder with the site it's called "web".
Then i've everything on:
c:/xampp/htdocs/web/.......
So I access to it via: http://localhost/web/
I've tested that all the non viewing images, if I append the "http://localhost/web/" on the 'src="/site/..."' they are accessible and look right.
So, is there a way to via .htaccess add the "http://localhost/web/" on those URLs who hasn't it? It doesn't only happens with images, it's just related with all the links, urls, srcs, whatever which is just "relative pathed".
I've already tried the "RewriteBase /web", but it doesn't work.
Need help to solve this so, please.
In summarize, the site online is just mounted on the root, so everything works, fully or just relativetly pathed. But in my case, I've got the development site inside a folder, so I need it to work too!
Much appreciated.
If this is a Drupal 7 site (might work for Drupal 6) make sure you have a tmp directory set. Go to admin/config/media/file-system and look for the temporary directory. Also confirm that you have this directory on your root, which for XAMPP is the htdocs folder.
This might be a file permission that can be caused by incorrect .htaccess settings (This link may help: https://www.drupal.org/node/2140629) in the folder set as your temporary directory.
This may also be a document root error. You can change that by editing the DocumentRoot setting in C:\xampp\apache\conf\httpd.conf.
This stackoverflow link may help if none of the above suggestions bear fruit: https://drupal.stackexchange.com/questions/30113/configuring-the-temporary-directory
I had a drupal site completely working at www.example.com/example. I copied the files to the root folder in attempt to simply have the site held at www.example.com yet now it is asking for a new install and I have no idea why, I expected to have to make some changes, but not to be confronted with the request of a new install. I have heard it may be something to do with changing the base url but I'm not sure. Can someone please help me?
Thanks heaps
Assuming your site is on a linux based hosting, most probably your problem is divided into two parts
Problem 1) The settings file "sites/default/settings.php" is read only so when you moved the site to another directory it most probably didn't move this file because it is read only, and that was pointed out by another person
Problem 2) The second problem may be the result of enabling clean urls and not moving .htaccess file; when you moved the site to another directory you may have left out the ".htaccess". Check to see if it is moved to the new directory.
Another possibility is that you have a modified .htaccess to make the subdirectory work, in that case you may want to get a fresh ".htaccess" file from here :
http://code.google.com/p/drupalgooglecode/source/browse/trunk/.htaccess