It took me all day to find what is happening; however, I found nothing.I am using Dreamweaver CS6. I want to set up a local Apache testing server as to run .php files. I did that. I 've followed the instructions given by Adobe, correctly. Everything is OK with the testing server since my .php files are running. The problem I cannot solve is the following: My main file index.php does not recognize any changes in any external .css file which of course is declared inside the head section. For example,
<link href="mycss/pb.css" rel="stylesheet" type="text/css">
where mycss is a folder inside htdocs/tester/ and tester is the folder inside which there are all the site files. There is no error in any path; in case I remove the Apache server everything works fine. There is no error in paths in Dreamweaver Apache setup:
Server Name: Local Apache
Connect using: Local/Network
Server Folder:C:\xampp\htdocs\tester
Web URL: //localhost/tester/
(with http: in the beginning)
However, any change made in pb.css is ignored by index.php!! This is crazy... I suspect this is a matter of php.ini, .htaccess, httpd.conf, I do not know what. I'd appreciate your help.
Thank you very much
Make sure the file is in the correct path.
Also press ctrl+F5 to refresh and clear the cache. Because the css file is stored in the cache of the browser so you don't have to download it each time. It just loads it then.
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'm trying to do some PHP learnin' but I've run into a road-block. I have MAMP installed and I am successfully serving my project files locally. However, after renaming my index.html file to index.php, the page is no longer served.
url is: localhost/projectfile/
I can rename the file back to index.html and the page will serve up again but this means my php code won't run.
I've tried digging around MAMP to see if there is some information/ setting that could help but I'm not finding a solution. It would be great if anyone has info on how this could be solved. Thanks!
You will find all the "start page" stuff in MAMP/bin/mamp (e.g. the English language page is MAMP/bin/mamp/English/index.php).
This is due to the following line in MAMP/conf/apache/httpd.conf:
Alias /MAMP "/Applications/MAMP/bin/mamp"
Refer Where is the index.* file that is served as the MAMP start page URL?
For anyone viewing this post- I must have edited a config file in the wrong way. I uninstalled MAMP and reinstalled and everything seems to be working properly now.
I have just setup the LAMP server on Debian. The initial tests were fine. After that, I've decided to change the home directory from "/var/www/" to something like "/home/user/public_html/". I did this changes in "/etc/apache2/sites-available/default".
The problem I am facing now is, that the PHP does not work in the new home folder. PHP sites are now parsed as text files and I can see the full source in browser (when clicking on view page source).
What can I do, that the PHP will also work under that path (and not only under /var/www)?
Look in php.ini in your php folder. There should be entries to change to 'doc_root' as well as 'extension_dir'. Make sure these are set, then restart Apache and it should work.
I have a problem with an Aws Amazon-EC2 SuSe instance, installed apache2, php5, mysql and everything needed to run a web application, we're able to see simple .html or .php pages, but when we try to view more "elaborated" pages with "incredibly complicated code" (excuse the sarcasm) like this
<link href="css/XXXX.css" rel="stylesheet" type="text/css">
or
<div style="background-image:url(img/XXXXX.png);>
or
<?php include('inc/XXXX.php'); ?>
or
<script type="text/javascript" src="js/XXXXX.js"></script>
or any other code (html, php, js, whatever) that points to a subdirectory (css,js,inc,img and so on) doesn't work (all response it's a nice blank page without any error messages like 404 or 403), if i move any necessary file to the root directory seems to work fine, and of course I'm not going to maintain a site with more than 3000 files at root.
Not sure if I'm missing any configuration at SuSe, Apache or PHP .conf files but already googled this question but i can't find anything (maybe I'm a little stressed with this and do not see the answer) to solve this to be able to maintain a "normal" directory structure, somebody can help me? thnxs a lot in advance.
Probably you have a .htaccess file in the root of the vhost and that is causing this problem!
I have to do a php project. I done php before so I understand the syntax for the most part. Just for a test, I made a file.php and in it I wrote:
<html>
<body>
<?php echo "helloWorld"; ?>
</body>
</html>
Well it won't display. The screen is blank. I tried it in chrome, firefox, IE and nothing wants to dispaly. Actually in IE, the source is displayed which is wierd. I also tried it without all the html and just used xampp to render it. It will not work. If I right click tho in the browser and view source, the code is there. Any ideas on what's going on?
Well, it comes from your web server configuration. If you're using Apache, have you enabled the mod-php module?
If you're new to setting up your own server, i would recommend using XAMPP (or WAMP), these are preconfigured PHP, Apache and MySQL servers.
If you're sure you have setup your server correctly check the following:
Make sure your executing your files from the server directory and NOT from a local directory. (your URL should look something like "http://localhost/test.php")
Note: You will need to phisically store the files in a place the apache server will look for, an example from XAMPP (on Windows, as thats what im assuming your using) is: "C:\xampp\htdocs"
Make sure your file ends in .php or something else that the Apache server will pickup as a PHP file. (.php3, .php4, etc)(make sure you didn't accidentally leave a .txt or something like that at the very end)
Check mod-php module is enabled (as Julien mentioned)
Hope that helps!
Edit:
Try
<?php
phpinfo();
?>
That as well, it should give you the php configuration information if the server is setup correctly.
EDIT2:
I see that you are using XAMPP, double check that the following file exists at the very least:
"C:\xampp\apache\conf\extra\httpd-xampp.conf", it loads the PHP module