I am working on a moodle based project, which I inherited from someone else. Having copied the files into htdocs folder and started MAMP, the files still don't show in the browser. Instead, the browser automatically initiates a download. I might be required to change the config file, however, since I do not have much experience with php and SQL I am not sure what exactly. My part of the project is to develop html and css, but need to be able to run it locally first.
What do I need to do to get the files run locally? The route I use is localhost:8888/whatever/whatever/index.php
In case someone else runs into the same problem - Apache downloads php files instead of reading them - here is what helped me.
.htaccess file may need changes if the application has changed servers.
Delete (at least rename if you don't want to remove it) config.php and run the application through the browser. It should initiate install automatically.
To run php and SQL I used MAMP.
Related
Any idea on this? I am currently using Laravel 4.2.
We have an existing web application already running in live. Something needs to be changed so I downloaded all the files from live server to my localhost via ftp and do the update in there. Everything is working fine in localhost but when I tried to upload(ftp) the select files (that were only updated- a blade file, a controller and a model), and and test the live site, the changes aren't showing. Checked the html elements thru browser dev tools and indeed it's just the old version. The id that I newly added in the div isn't there.
I checked in the filemanager if the files were successfully updated and it's there.
I am done doing the following:
cleared my browser cache, cleared files in /app/storage/views. What else to do?
Is updating the files thru FTP for laravel not good? Honestly I am just a newbie to this framework so your explicit explanation would be appreciated. Thanks!
Laravel compiles all files before they are deployed most times. If the files are not recompiled on the server, then it's gonna keep running the old setup. if you have terminaal access, runningphp artisan clear-compiled may fix your problem. I may be wrong but this is what i see from where i'm sitting.
I been using gulp for front-end development lately and I find it very helpful.
I use XAMPP in windows for making PHP website some of which sometime include database operations.
Now, I have used gulp-livereload and gulp-connect for starting a server for front-end but then it won't process the PHP files.
All I want to do is, PHP livereload with database access. Like livereloading but via XAMPP's server(since it can process PHP).
yes, I have found a temporary solution for now.
See, it's just temporary but as long as you write PHP correct, you will get the work done. Let me tell you how I do it.
Though right off the start I want to tell you that this is not a proper way to approach this, you should use some MVC framework.
Anyway,
I have XAMPP installed under Windows 8.1 and XAMPP's htdocs is in my "C" Drive.
I then create a folder inside "htdocs" in which I put all my frontend + backend code.Basically, gulpfile.js is at the root, then there is a components folder in which all front-end sources reside. There is another folder at root called "www" inside which I put my index.php.
Then I load gulp-livereload instead of gulp-connect and I add the livereload.listen(); method and Tags in all the php files I want to reload.
Works very fine except when PHP throws an error, untill you correct that error, you have keep reloading the page manually.
Before everything happened, I was running this wordpress install for developing themes using xampp. But I decided to upgrade the memory of this machine from 2GB to 6GB since I need extra room for applications. I back-up my code in a separate partition by copying them. Since I have a 32bit OS at the time, I format the computer and installed a 64bit version. All is well and fine the OS side.
When I setup my web dev environment something goes wrong.
When I imported my htdocs back, first by just fully copying them to a new fresh install of xampp and notice that all of the codes that put are not working. My CI code is displaying my PHP code in the browser. My theme in wordpress is also commenting out my PHP code when I view the source. The themes included in my fresh wordpress install works so there's something I am missing here.
From the looks of it, the php is being executed properly since anything that I install works. Just that the ones that came from a previous xampp is not.
Open up the php.ini file and set short_open_tag = On. Then restart apache.
If you are opening a local script directly in the web browser, maybe through your editor, double-clicking on the file or dragging and dropping the file ito the browser - it will be treated as HTML only.
Instead, open the file by typing... http://localhost/your-file.php into the address bar. I personally create a projects folder in the htdocs folder and then create a bookmark for... http://localhost/projects/ and this will display all my projects that are saved into my projects folder.
Note: if you changed the mail port for the Apache server, you will need to add that to the path as well. eg. If your main port is 8888, your would do this... http://localhost:8080/your-file.php
I had the same problem and this worked for me. Good Luck
For me, it was because the file was named as ".html". You must have an extension ".php"
im doing a php project. all is fine doing it in xp webserver which im using iis..but now i have set up a new pc with windows 7 and iis.
problem is when i copy my php files which is in a folder(e.g portal1) from the xp wwwroot to the windows 7 wwwroot, i cant access it on the browser. it returns an internal server error.
now i assumed i didnt properly set up my web server or even php. i have done it a dozen times following tutorials and im pretty sure its all correct.
i have done a further research on the folder itself and has led me to a theory that this has to do with permissions.
when i copy directly the whole thing,it wont run, BUT if i CREATE a folder and the subfolder with all the same names as the one i copied and just take the php files and put it accordingly, it runs ok!!
now that has something to do with inherited permission i think. how do i overcome this?
i dont want to everytime take the updated work folder from my partner which is done in xp and i have to create new folder and its subfolder with all the same name on my machine and then copy the php files accordingly. thats a lot of work!!
i just want to copy the folder and put it in my wwwroot folder and run it on the browser without problems. how do i overcome this permission issue?
any ideas?
By the sounds of things, you're working on a project with someone else. Copying & pasting is the absolute worst way of sharing files when working on a project with multiple people. You should really be using versioning like git. That's pretty hard to set up and learn though. An easy solution which will work for the time being (but won't manage conflicts well) is to use Dropbox. Set up a free Dropbox account, and create a folder in that called www or whatever you want. Then install WAMP (way better than IIS), and create an alias to the www folder in your Dropbox. Do this on both machines. Now every time your partner makes a change, it will be instantly reflected on your machine, and vice versa. Easy, free, and will work while you learn a versioning tool.
I know this doesn't address your actual problem, but it should be more helpful to you.
I am trying hard to use version control but i am so used to old method of editing files directly via FTP that i am feeling confused what to do. So i am thinking of one solution and please help me with this if its possible or not
I have the user folder in Linux VPS system(Single VPS only)
/home/user/public_html2
Now that will be linked with Http://demo.server.com.
That directory will be version controlled with repo in the folder /usr/bin/repo/ so that i can commit the changes.
Now i will have another directory called
/home/user/public_html which will have the contents updated as the commit is done in /home/user/public_html2.
That /home/user/public_html will be linked with http://main.server.com
So that i keep working and editing files in public_html2 via FTP normal and test code as it is but main site is version controlled
Is it possible??
When you are using a version control system, why do you need to of to a FTP location to edit the files... It defeats the whole purpose.
Rather, checkout the files from the repository into your local machine and after the changes are done, commit the code.
If you don't want to use the version while working with the files on your local, simply export the code instead of checkout.
The problem I see from your approach is that the files / directories may go out of sync. Also, if there are multiple users working then this approach would bomb.
I would suggest to have the working copy of the files in your local machine and use them instead of mirroring them to another folder.
Maybe it's possible. But once you start to use version control systems, you should keep accessing your version controlled files through that system.
Or better, if you want to access files in "normal way" as you said, then if you access that files without committing any change then it should be ok. But if you want to modify them, you should always pass through your version control system, otherwise you could have problem with file versions.
You need a deployment script. Create a script to upload the files to the appropriate locations. Run this script whenever you wish to see your changes reflected on the site. If you wish to maintain two separate locations on a server running different versions, simply add a command line argument to the script to choose which location to upload to.
Use rsync instead of FTP if you can, to avoid transferring unchanged files every time.