I'm setting up a project made by 2 other colleagues and I'm have a problem when putting it online.
On my local machine, everything works like a charm but online I canĀ“t link any file at public folder, php scripts, images etc...
Does anyone knows if there's anything at symfony config's that can make this behavior?
I figured that out.
The images were visible if I link to them directly like www.example.com/uploads/1.png
But the rewrite rule was not working because the .php script was giving an error so the rule was ignored.
Re-arranged permissions of files and folders on public and now everything is working
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 am working locally on a webpage in laravel with wamp, everything is going smoothly except that my routes are not working I have watched youtube videos and exactly followed their instructions
Route::get('/',function(){
return view ('client-side');
});
this is returning a 404 page
also I have tried returning a simple echo with this code
Route::get('/hello', function()
{
echo 'hello man'
});
And this also returns a 404 page, I dont understand why this isnt working, ty in advance
You said you were working locally with WAMP. But you were not specific about how you were trying to access your website. So, I am wondering if you need to add public to the end of your URL. See, Laravel reads from the public directory. If you are using WAMP, then most likely you haven't don't have it reading from public.
So, let me give you an example. If you are using myWebSite as your directory from your WAMP directory, if you haven't set your hosts files, etc., then you would need to access your website like this http://localhost/myWebSite/public. Make sense?
Another way of accessing your website would be to use the built in web server. From a terminal window in the root directory of your project, type php artisan serve in the terminal window. You should then get a message that says "Laravel development server started: http://127.0.0.1:8000" so then you should be able to access your website at http://127.0.0.1:8000
Probably your problem is in calling url.
Image that your project in htdocs.So you should call your page likethis:
localhost/{YourProjectFolderName}/public/{route}
If you want remove public from url you should cut its content and past it in previous path and edit index.php file.
If you want remove {YourProjectFolderName} from your url you should edit config of wampp.
I have written code in laravel and have managed it with GIT.
Now I made some changes in the homepage which is not reflecting on the server but working well on the local system.
Things I tried to fix the issue
Cleared the cache, views also manually deleted from the framework folder in storage
Changed the cache method from file to array
Created a new server and deployed the code from git but got the same issue. (Yes the code in html file has the updated code and i can see it using vi and cat).
More importantly i can change the files in other html files in admin folder and it works fine and update is reflected in the browser.
i also tried deleting the view file but it does not work also tried copying the file with new name and using the view but no change in the result.
Please provide me with solution if anyone has ever faced it.
There was a index.html file in the public folder. Which was being called
(* 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)
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