running php scripts without xampp - php

I have my own domain and I installed wordpress manually. I currenty have a wordpress theme on the site that I haven't touched. I'm new to developing, but I installed wordpress manually without the help of any installers. I made the wp-config file from the wp-config-sample file and entered the database info like I was supposed to, but I still need to secure the passwords. And I locked down the ports I was supposed to in plesk. So I know a little so far but I have a very basic question. In xampp, you run php files in localhost after placing them in the htdocs folder. But now I have my own site. How do I run a php file now that I have my own site and server and don't need to use the apache server?

Related

Themes, Styles, Images not working on MAMP local dev WP site

My recently downloaded-to-MAMP WP site is not displaying any CSS, styles, themes, or images. The live site broke after a PHP upgrade. After some panicking, I downloaded the WP site (all files, manual installation, FTP download) and exported the database. After a lot of trial and error, I got it just about running on the MAMP localhost, with PHP back at 5.6 (site broke on 7.0).
I did not install Wordpress directly, simply the root directory from the live server in the MAMP localhost folder. The site is displaying the text, line breaks, paragraph breaks, and image holders, but no styles or grid or anything - bare HTML.
A quick check with the inspector shows that the image-holders are pointing to the correct path for images, and the images are in the relevant folder in Uploads.
I tried deleting all plugins from wp-options, and changing themes in the database too.
I can't access wp-admin either - too many redirects. The site is obviously connecting to the database, styles.css is in place, the theme is named correctly, I have tried reverting to twentyfourteen too. No joy. Any thoughts? I can't move it back to the original server space now either and revert to the older PHP either.
Do you have a Full backup of any state of your Site? Did you check wether the PHP versions of Mamp and WordPress match exactly? Try to install a clean version WordPress on Mamp and then insert the databases. Don’t forget to change your WP config file to the local host address that MAMP is using.

Moodle: Invalid login, please try again

I'm migrating Moodle from one hosting to another but first I want to install it on my PC so I can use it as a reference guide. There's no way to check my old hosting files because the contract with them was already cancelled, I was recently hired for this job and it was a surprise.
I have a back up of everything they had (moodle and moodledata folders, database... but they didn't back up their courses, I only have folders and database). And now I want to install it on my computer (I want to have a reference of the contents and structure of the courses, etc).
I'm running Xampp, I copied the folders under htdocs, modified the config.php file to connect to the database and the page looks the same as the original, but the problem starts when I want to start my session with username and password, because Moodle no longer recognizes my login data. It's very weird, because I copied everything as it was in their old hosting.
I also have adapted the paths of directories and files for Windows in the config.php file, but still doesn't work. Does anyone know what might be happening? I'm attaching my config.php for you:
config.php
I should clarify that the version of Moodle I'm running is 2.6.11 (their hosting had PHP 5.3.29 and MySQL 5.1.73-cll and I tried running different versions of Wamp and Xampp with many different versions of PHP and MySQL). I know, it's terrible they didn't migrate before.
Did you copy the password salt from the original system to your local config.php?

how to find wordpress files on linux installed from bitnami

super frustrated by this problem. I am trying to learn wordpress development and I have been trying for hours to find the files I need such as functions.php but alas I can not find the files
Does anyone know where functions.php and other wordpress files would be on linux installed from bitnami?
I have found /opt/lampp/var/mysql but I can not access it with the permissions it has.
I have tried changing the permissions using chmod but I still can not get into it.
it's under apps/wordpress/
The following is from their readme file.
apache2/: Apache Web server.
varnish/: Varnish Cache
php/: PHP Scripting Language.
mysql/: MySQL Database.
apps/
wordpress/: WordPress application folder
conf/: WordPress Apache configuration files
htdocs/: WordPress PHP application files
phpMyAdmin/: phpMyAdmin application folder (optional)

MAMP moodle project

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.

My PHP code is commented out

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"

Categories