I develop a php script software for a school. I install it on a school computer by using xammp server, but I'm facing a problem. How we secure our code on that system? Anyone can copy, edit or delete easily by going c/xammp/htdocs/ directory. What we do that my code not show anyone and how we can give trial period to customers?
Limit permissions in the folder htdocs, you can use this guide to accomplish it. Make only accesible and/or viewable for your local user (and the user who will run XAMPP)
Related
I created a my_functions.php file and installed it to WordPress as a plugin (started with something real simple, then expanded it).
It does what it's supposed to do, but it runs every time the web site is opened.
I left in the echo commands for debugging so all the comments are displayed, and after it ends, the web site is displayed.
I can fix that, but here's the real problem: I can't log into WordPress-Admin in order to fix it.
When I log into wp, the function runs and ends and that's it - nothing else - it doesn't take me to the admin area.
I tried using FTP to log into wp, but I'm not that familiar with FTP and I'm getting a credential error. BTW, I'm using my wp login info.
Maybe there's a way to prevent functions from running during login, like shift-run in Windows that prevents on-open scripts from from running?
Thanks for your help.
FTP: Wont be the same as the wp login details. You need to get those from your host.
You can deactivate the plugin by logging into your web host cPanel, locating the plugin folder in /wp-content/plugins. Simply download a copy of the plugin folder then delete it from the web files. Wordpress will then load fine and you can take the time to go through your code.
You would be better to setup something like XAMP (Linux), WAMP (windows) or MAMP (mac). Its local development environment which will allow you to develop locally so you can access files though your normal file manager.
I have a client who wants me to update their Drupal site. I've never done this before, and I want to work on it from my local machine just in case something goes wrong. I have no idea where to even start!
First off, how do I access my client's site files so I can get them onto my computer? I've tried entering the information the client gave me into Cyberduck, but it won't give me access. Is there another way to get access?
Also, how do I host it locally? I have XAMPP, but I'm not sure how to use it.
That being said, I have found a few forums that should help me set up the local server. I just don't know how to get the files from the live server to my computer.
I know this is a super noob problem, but I could use the help. Thank you!
Well, for the basic question, you have to get the correct credentials from your client. There's no alternative, really :D
While you're at it, you'll want a copy of the site's database too.
For the question "how do I host it locally?" Here's how I would go about it.
Get the site into version control.
Given that you were given (S)FTP credentials, I'm guessing the site is not version-controlled. If that's correct, then that is probably the very first thing you want to do. This will allow you to keep track of the changes you've made on your local site that are different to the production version.
Create an empty directory on your computer.
Navigate to the directory in a terminal and run git init.
Add a .gitignore file to that folder (you can create your own, or use one customized for Drupal).
Download the site's files into the directory created in step 1.
Add the files from the in the directory to the git repository by running this command in a terminal: git commit -am "First commit of Drupal files to repository."
There's a good help page about working with Drupal in git on drupal.org.
Create and populate your database.
Get a database dump from the live site.
Create a new database and database user on your machine.
Import the database dump into your new database.
Record the database credentials in settings.php or settings.local.php and store them somewhere safe, preferably in a password manager.
Change the database credentials in settings.php or settings.local.php to match the credentials of the database you've just created.
(For safety and to avoid confusion, I always create local databases with a different name, user, and password than the live site has. This means if your local credentials are compromised, the live site isn't, and it means you can't connect to and change the live site's database by accident.)
Set up the webserver in XAMPP
Create a new site in XAMPP called e.g. example.local that points to the directory that contains the file index.php
Add the following line the file called /etc/hosts on your computer:
127.0.0.1 example.local
Test that this works in a browser by visiting e.g. http://example.local or http://example.local/robots.txt.
Move your local changes to the Production site
How you will be able to do this depends to some extent on your client's web-hosting infrastructure, and what version of Drupal your client uses. but in any case, you will have three separate concerns for changes you make:
Code changes
You will need to deploy changes you make to the code back to the server. Ideally you would probably do this via Git either by cloning directly into the live site or (far better!) as part of an automated build process. By the sound of it, you may just have to FTP the changes back up.
Be careful not to re-upload your modified settings.php or settings.local.php file!
Content changes
You probably have to test some/all of your content changes locally and then recreate them on the live site. Because your client may have made changes to the live site while you were working, you can't risk importing your local database into the live site.
Configuration changes
Changes to configuration should be managed in code (i.e. as part of 1. Code changes above) if that's possible. In Drupal 7, the Features module is usually the best way to accomplish this (here's an answer I wrote describing the Features workflow). Drupal 8 has the Configuration Manager. Be aware that these two tools can both be tricky to use well.
Your client needs to gave you access to the files so you can put them into htdocs on XAMPP, then you need the database (also provide by the client), start XAMPP, create a new database on localhost/phpMyAdmin and import the db of the site. On the proyect code go to sites/default/settings and change the db settings to your local settings. Then you can go to localhost/{your-proyect} and it should work.
me and a coworker are trying to move a website from a test server to local web development. Our boss wants us to use Amazon web services CodeCommit in conjunction with Xampp to do this. We have made progress but cannot overcome a database issue. Here is what we have done.
Set up AWS accounts and recieved necessary credentials from boss for the sites repo
Pulled repo and ensured that we could both commit and pull normally
Downloaded xampp, made sure apache and php were functioning normally
Now, one of us (me) has used the duplicator wordpress plugin to backup the site and load it into a local version.
I can now develop locally fine and push changes, all images and pages from the site are showing up locally
ISSUE:
How can my coworker also develop locally, the issue appears to be that he has not made a database in xampp phpmyadmin control panel for the site, but if he did wouldnt it be a different one than I am using, and thus wouldnt sync with git properly? Where xampp stores the database info isnt in the git folder, so I may be doing it wrong as well!
We cannot figure out the correct course of action, please if you can point us in the right direction. Much appreciated!!
I have installed Wampserwer on my computer, and I have access to files on hosting via WinSCP.
Website is running on CakePHP
Can anyone, please, explain what steps do I need to do, to make a copy of my website on localhost. I cant find any usefull instructions
Thanks!
localhost is working
access via winscp to files
Copy the files to your computer
If your site uses a database, you have import that one, too + create a user/password
You have to configure your webserver for Cake. Find instructions here: http://book.cakephp.org/3.0/en/installation.html#installing-cakephp (in your case, search for Apache)
Good day!
I've searched for many sites on how I could deploy my PHP projet in the internet but I don't know how to do it because I am confused with some of the technical terms.
You see, I am using xampp for my local web server. Now I want to put it in the internet. I found some free web hosting sites so i've decided to upload all my htdocs files inside it.. But how can I put the xampp (apache server) and my mysql database on it? I'm confused. Please help. A step-by-step procedure of what should i do could be really helpful. Thank you in advance.
Get a hosting account (try www.bluehost.com for instance).They will set you up with a Linux server and MySQL. You don't have to install Apache or MySQL, you will use whatever they've got. All you need to do is upload your PHP files to the right folder, setup your database on their server and you should be good to go.
If you buy a domain-name and space, connect them using the NS settings
If you are using a free, then the settings are already okay.
Export the database from your XAMP.
Login to the remote server. There you'll find PHPMyAdmin. Import the database.
Upload the file.
Make sure file listing is off. That is if a user goes to any directory he can not see the file list!
Done :)
Simplifying a bit, there are two ways you can get your site online.
First, you could purchase or rent a server that is yours and yours alone. This is commonly called "dedicated hosting" and costs somewhere around $100 / month. If you choose this option, you have your own server housed in a datacenter somewhere, and you must install Apache, MySQL, and any other server software you care to use.
I doubt, given what you've described, you have chosen this option.
Second, you could rent "shared hosting" from any one of the dozens of hosting providers out there. If you do this, with a typical cost of $2 to $10 per month, the hosting provider is administering the server. You have no direct access at all. Your only access is through the tools they provide.
Given that, how specifically you can upload files is up to them (is it FTP? SSH? a horrifying web-based upload tool of some kind?) Similarly, how you access your MySQL databases (assuming they offer MySQL databases) is entirely up to them as well.
Many providers now use a tool called cPanel for this administration, so you may try browsing to www.example.com/cPanel (using your domain) on the off chance that works. If not, though, follow the instructions your host provides. Only they can correctly describe how their setup works.
The hosting will be already having apache and mysql installed you only have to put your files thats it
I suggest you contact your webhosting site. The web hosting needs to host php, and mysql. Then you can upload your files to their web server, and copy your mysql database to their mysql server.
You do not need to transfer xampp to your host: apache and mysql are running on nearly every server
Upload all your files in your htdocs directory via ftp to your server
To transfer your database, use phpMyAdmin. It is installed with xampp and alos installed on nearly every server. In phpMyAdmin, use the export/import functionality
In your php file where you connect to the db change the login settings to the settings the hoster gave you
That should work...
Hosting Company already have setup for apache,php, mysql. All you need to uploads all your
files from xampp htdocs to a right folder like public_html using a ftp software like
filezilla. They also provide a control panel like using which you can manage your mysql
database and all others settings like directory permission.