How do I view the files on my server? - php

I am developing a web application using Laravel. I am using Laravel Forge with a Linode server and GitHub. My site is live at the moment. Whenever I change the code, I commit the changes using GitHub for Windows and then deploy the website on Laravel Forge.
One part of my application allows a user to upload a file. This works grand. I can upload a file and then download it from another computer on the website. However, I am not sure how to view the files on my server. They are not appearing on GitHub, and I cannot see anywhere on Laravel Forge to locate these files.
Anyone have any ideas?
The files are definitely there as I said, I can download and view the files once they are uploaded. I am storing them in a files folder in my public directory.

I guess your problem is that the versioner(Git) is ignoring your files.
Verify that where your files are stored and that the .gitignore files in each folder do not ignore them
*
/ Storage_path
Storage_file.extension
*.extension
Modify your corresponding .gitignore files and then commit everything

Related

Updating composer library after files deployed to shared production server

I created a website using laravel.
I uploaded the site to my shared server, and site was running fine.
After that I had to add a library called Intervention. In local, I used this command and everything is working fine.
php composer.phar require intervention/image
I made changes in files and everything is working fine in local.
Now, I need to upload the updated files. So rather than deleting whole online folder, and re-uploading, I just want to upload changed files (I know the controller, view files that were changed).
But, as it is a shared server there is no way or place to execute composer update command or get that one library (thus now I am getting intervention Image class not found error).
So, what would be ideal thing to do in this case?
The easiest one maybe delete the whole folder and upload it again but the files are almost 500mb so do not want that.
Any suggestions to handle this situation? (updating composer libraries after deployment)
Not really a php or laravel question, but if you're using ftp to upload there's usually an option to only upload changed files.
For example in filezilla you can set the over-ride option here:

How to configure codeigniter with site files in xampp?

I've recently taken over a project from another developer, let's call it EBAY. I'm struggling to get their live site up and running on my local server for testing and debugging. They've built a web app using CodeIgniter. In their file manager on cPanel they've placed the ci folder at the root, not in the public_html folder.
I've copied their public_html files and their ci folder into my xampp's htdocs folder. The issue is that the site only loads when the ci folder is placed WITHIN the folder for EBAY. Oherwise when I load the localhost site it gives an error message that it cannot find the codeigniter folder inside EBAY folder.
How is this? How can the application run with the ci folder at the root on the live site, but when I have migrated it to the htdocs of xampp it is expecting the ci folder to be inside the EBAY folder?
This kind of configuration is quite common nowadays, and if you look at Linux or Pear you'll discover that PHP files sometimes are completely in other directories than the webserver.
The ideas behind this are pretty simple but effective:
Any files can't be reached from the network / internet.
So they can't be altered, downloaded or even just viewed.
PHP (or other) Libraries are clearly separated from individual code and can't be easily mixed up or accidentally be deleted.
Access rights are easier to control and perhaps even that differently than the files in the webfolder.
Ok, so far an explanation. Now about your issue with it:
You've currently a webfolder htdocs in Xampp and in general you can use a subfolder as the webfolder and in htdocs directly you place the project files that are not public. You've to adjust then where the domain is pointing (docroot and/or virtual hosts).

How to edit php files after building angular app

I want to deploy my angular app on 000webhost. I used ng build to build my project and I uploaded my dist files to the file manager of the webhost. However, my website contains php files with credentials and urls linking to folders in the project such as :
baseUrl:string = "http://localhost/lfsa-db/php";
return this.httpClient.post(this.baseUrl + '/register.php', { first_name,last_name,father_name})
My dist files are all .js with the index.html. How can I edit these lines of code ? They were in a .php file before building the project.
Navigate to where your files are stored, make changes to those files and re compile your app / refresh the page. When you upload your files to 000webhost you should be able to make changes to them. If you can't, make changes to your angular app locally and re upload the files.
Hope this answers your question.
This is just my personal preference but I would use a git hub repo and deploy that. Using github will allow you to make commits to your branches and your web app will pull from the git hub, easy way to make changes after deploying.
When using webhosting software linking to a github gives you more control, at least in my opinion.

How can edit deployed laravel project

I have website that create from laravel. I want to do some customization to that. Project files does not have in my local machine. I have files that deployed to my hosting. I need to help for edit it. How can i do it
Simply download your files from remote host, edit anything you want and re-upload them.
It's good to remember that you don't need to download the vendor folder,
since you can use composer install when you have the files in your local machine.
After finishing the update, upload the files back to the server, and, if you have ssh access, run composer update, to update your dependencies. If you can't use ssh, just overwrite the vendor folder on remote host.
Hope it helps.
I will assume that you are using a IaaS
First:
You can do it by accessing via ssh with PuTTY, if you're completely sure what to change. Anyways it is the easy way but not the best one.
Second: (What I suggest)
You can use a version-control system, via Github. You can use to upload your local changes and pull them in your deployed server.
Third
You can use filezilla to tranfer your files to the server fia FTP.

sync project in netbeans both ways via ftp

I have a question about netbeans.
I made a new netbeans php project, configured it with the existing ftp settings, and it started downloading all the files to my local hd, so far everything is working correctly.
but because I'm using a php framework, which will automatically generate some files for me makes a file, it won't be synced to my local hd.
So my problem is as long as I make new files in netbeans it will work correctly, but when files are generated outside netbeans it won't.
How can I configure netbeans so it will sync both ways via ftp?
You can't as far as I know. You have to manually right click on the project/folder you want to update and click Download or Upload. Note that this will overwrite any changes on the receiving side (e.g. downloading files will overwrite local changes and uploading files will overwrite remote file changes).
Alternatively, you can have the Upload Files On Save or On Run options enabled, but this will only work for local->remote synchronization scenario. You can access this option by right clicking your project, choosing Properties and following the screenshot below.

Categories