Laravel, homestead VM phpmyadmin installation - php

I'm unable to properly configure phpmyadmin in the VM provided by Laravel.
These are some of the questions asked when installing it.
Pass: secret
I've tried "phpmyadmin", "homestead"...
Here's what I get:
I just can't seem to make it work, I've been struggling with this for quite a while now.

Here is another option that I had suggested on another question, a much simpler DM admin program than phpmyadmin that is full featured and is a breeze to install (it is literally just one php file):
Another alternative that I found super simple and that worked right out of the box I set up a new Nginx site from inside the Homestead box using the serve.sh script:
serve adminer.app /home/vagrant/Code/adminer/
And then in there I dropped the one page successor to phpmyadmin, Adminer. I also renamed it to "index.php" to make it just work. Then after adding the adminer.app entry to my hosts file I was good to go.
Had not used a web based MySQL interface in years since I just didn't like maintaining phpMyAdmin but this one is sweet. One file (plus an optional CSS file if you want a nicer theme) and that is all. Easy to maintain and update.

Related

Multiple Instances of XAMPP on an External Portable Harddisk

Running Windows 11, 64 bit I need to install multiple instances of XAMPP on my external Hard disk. The drive will always be associated with the letter Z.
The purpose is to learn XAMPP including what the stack is made of i.e., Apache, MariaDB/MySQL, and PHP. Learning route is through various tutorials and online video courses such as:
WordPress Full Course in ONE VIDEO | ZERO to HERO | STEP BY STEP
How To Make A Digital Agency Website From Scratch In 2022 (WordPress And Elementor For Beginners)
These tutorials/courses asks to make projects such as the first is centered around "mywebsite" and the second is "jimakes". In order to do so I was thinking to have one installation of XAMPP at (I am using the Lab as the main folder in the drive Z)
Z:\Lab\xampp\htdocs\mywebsite
Z:\Lab\xampp\htdocs\jimakes
Now I will have 1 XAMPP installation and multiple WordPress installations (The WordPress installtions will be in each of the projects respective folders so that tinkering one WordPress installation does not effect the other).
The problem is following through the 2nd course/tutorial and installing the WordPress theme (jimakes), Astra, I came across problems that required me to change some settings in the .htaccess file and php.ini files which I messed up. This resulted in messing up the "mywebsite". This required me to uninstall everything and do a clean reinstall of XAMPP and WordPress. And that resulting in also removing the htdocs folder. (There is an option of not removing that folder during the uninstall process but I don't want to do that say just to be sure I have a clean reinstall with default settings).
Now I am thinking to have multiple XAMPP installations and a single WordPress installation such as
Z:\Lab\mywebsite\xampp\htdocs\PUBLIC_HTML
Z:\Lab\jimakes\xampp\htdocs\PUBLICC_HTML
The purpose is two fold. First I can happily chip away with messing everything up in one project and it won't effect the other. The second I am trying to replicate a real hosting live server from one of the server providers such as Go Daddy or Host Gator as much as possible so that migrating from the local development environment to the production one is as pain less as possible when I move on to real projects.
Now to cut the story short and trying to catch the river in a cup I would ask
To create a exact replica of the hosting providers environment on a local development environment with the aim of firstly learning technologies such as PHP, MariaDB/MySQL, WordPress and later on exporting real life project from the local development to hosting environment with the confidence that all I need to do is move the files (FTP via FileZilla?). This cannot be achieved since if I am not wrong, one can never install cPanel locally. Secondly who has the time to consider in so many variables for example you cannot create a new database or user using phpMyAdmin in a hosting account but you can on a local environment.
WHM & Cpanel cannot create database
What needs to be changed for once and once only. You will notice that I have changed the htdocs to PUBLIC_HTML as the root document folder (Is it same as the Server Folder?). The aim is to actually learn PHP and WordPress and MySQL without being bothered about why it's not working. I know why it's not working itself is an important part of learning but it just muddles the waters since your objective is to learn the technologies and not why it's not working (The why it's not working comes later, don't ask me why, I am too dumb to learn two things at a time).
I tried installing Apache, MySQL/MariaDB, and PHP manually without using XAMPP. This resulted in learning about more about installations and errors and how to fix them and blah blah blah rather than actually learning PHP, MariaDB/MySQL and WordPress. Exactly the thing that I was trying to avoid. Some would argue you cannot learn one without the other but I already have HTML and CSS under my belt (I know, I know, JavaScript, I will get there) and again the purpose is to move to the backend and save time by avoiding and worrying about how to fix them errors (took me two hours to figure out why my php manual installation was not working. Turns out one needs to set PATH in system environment variables in Windows 11)
PHP Not Executable in Command Prompt Windows, Environment Variable is set
Why can't I just use a hosting provider production environment? Than why XAMPP is there?
You have a lot of asks here, you shoould split them to individual asks, i Will help you with the Title Ask.
Is as common task have into dev environment many projects, but you can run all with a single instance and a single port, such as 80 in dev machine.
You can set Many Virtual Hosts so istead of use default http://localhost you can create a better host for each project, Eg:
http://project1.local
http://project2.local
and proceed with development with no pain, here a tutorial, teaching how you can create this env.
https://www.wdb24.com/how-to-setup-multiple-virtual-hosts-on-xampp/

Quick Admin Panel | Unable to locate a class or view for component (only when live)

I am trying to get a Laravel 8 project up and running on Hostinger's shared hosting. I realize I'm already complicating things but have successfully set things up besides the components. I am using Povilas' Quick Admin Panel (Livewire ver), and it's this that requires components that are only 'missing' when on production server. Everything runs smoothly on localhost.
I've read that this may be caused by namespace issues - the environment may have case sensitivity (if so, how can I work around?). Other posts explained how each component should be visible in Http\View\Components as well as in resources\views\components. I've also read something on the existence of default/packaged components but can not find documentation on these individual ones.
I am looking for components 'x-application-logo', 'x-dropdown', 'x-dropdown-link', 'x-responsive-nav-link', and more. I do not see ANY of these in my local files, yet it all works fine in a local environment.
Yes, I've seen very many similar questions asked. However, in all of those cases, the askers were able to visually locate their component files, or were using self-declared components...
Has anyone working with Quick Admin Panel had similar issues?
I've attempted:
php artisan cache:clear, config:clear, view:clear,
php artisan optimize,
composer dump-autoload,
recompiling with npm then reuploading files,
composer install (and composer2 install)
I ended up installing a fresh instance of Jetstream to copy over its source files. After a few tweaks I got something to work without errors... As I've come to find out, the entire admin panel that I was working with had wiped itself, and for some reason started requiring an instance of Jetstream?? I have no recollection of touching any sort of configuration regarding this, so either there's a carbon monoxide leak in my home, or Hostinger is deciding to automatically mess with my Laravel files for one reason or another. Thankfully I have a proper local version of my project, which I will use to reattempt.

Running Wordpress repo locally through MAMP. Assets not being pulled in

Currently I am trying to run a Wordpress repo locally for development. I am not using MAMP pro even though I still have a 9 day trail. I figured since I'm going to be using the free version for now I might as well work with that. I have my Apache & MySQL server running along with the Document Root pointing to my Sites folder where my projectName repo sits. I'm still running off of the default port of Apache 8888.
After I start the servers, I open WebStart and import my DB into phpMyAdmin. Everything works perfectly fine and the copy of my db gets imported. I then make sure that my wp-config.php file has the appropriate settings to access this db. I then click on My Website. This pulls up the content of the website. However, it does not pull in any of the assets(imgs/js/css). I receive the following errors in the console:
Failed to load resource: net::ERR_EMPTY_RESPONSE http://projectName.dev/wp-content/uploads/2016/09/logo-footer-1.png
Failed to load resource: net::ERR_EMPTY_RESPONSE http://projectName.dev/wp-content/themes/projectName/images/circle.png
And so the list goes on and on for pretty much every asset the project could possibly have. Now configuration is NOT my strong suit, and at this point I am at a loss of what could possibly be happening. Awhile ago I did follow a tutorial on how to setup my files so that I can access them in the web browser by simply typing the name of the project with the domain .dev, example: projectName.dev. I started having issues with this after upgrading to OS Sierra and it no longer works. Could this possibly be the reason as to why it is looking for these assets in the projectName at the .dev domain?
I apologize if this does not make sense. I am willing to provide anyone with any information on this as I need as much help as possible because I still need to level up my configuration skills. Let me know if you have questions.
The images and other assets are referenced with an absolute filepath (i.e. the URL of the server on which you first set it up). This has to be changed in all database entries. There are tutorials for this on the net, but the most simple version is to open the sql file in an editor and search & replace the general URL part in the complete database.
Be sure to keep a backup of the file - that might not work on the first try...

How to access php project from localhost (Apache)

I know this question may first appear to be a duplicate of others, but I'm asking this because I have WordPress installed in my /var/www/html directory. I was learning WordPress a couple of years ago before creating a website and never used it again.
Well, I'm creating a php project using PhpStorm and testing in my browser. I'm following a tutorial so I can configure my databse (phpmyadmin), and the instructor keeps going to his localhost, which displays the directory structure as seen here:
Since I have WordPress on my localhost, navigating to that takes me to my WordPress installation, which is not what I want to access.
I would rather ask this question on here before I potentially break my Apache configuration, so how can I access this project? Do I need to remove WordPress completely? It would be nice to keep it for future testing since I'm slowly getting into making plugins.
What are your suggestions? I can't really say much as far as "what have you tried?" since I don't know where to begin.
Running in Chrome within my PhpStorm IDE takes me to localhost:63342/projectName/respectivePhpFileName.php, but I can't access it outside of the IDE yet.
Any help would be appreciated.
Just move your Wordpress outside your htdocs folder...I think he is using something like XAMPP so in that way is very easy to do it, because the folder without an index will be detected as a directory not a Wordpress URL (correct me if I'm wrong). So if that doesn't works, just go to your htdocs (/var/www/html or opt/lampp/htdocs in Linux) directory (or where your wordpress is stored) and move it to other folder (like My documents) where you can backup it, and that's it, you can create that folder and keep following that tutorial.

Managing wordpress environments

I have small team (4 developers) and we created a site, that has currently 500 users.
Our development cycle looks like this:
We make changes (install plugins or customize code) on our localhost.
We push it to development environment. We can do stress tests, we have a couple of test users and so on.
We evaluate it.
We push it to production.
Deploying new code is as simple as git pull, but the real problem is database.
Almost all plugins require me to click something in admin panel. What is more: some of them create new tables or update existing tables when I install them. For example add some new user metadata for every user.
I thought about some solutions:
Installing plugins manually on all environments:
I can install plugins manually, but this is error prone.
We had a couple of situations, where code was the same, but sites worked different because of some simple misconfigurations.
Exporting whole database:
Export production database and import to dev.
Install plugin on dev.
Migrate dev to production.
It has a real problem - it is not atomic. If user created a post while I was installing plugin on dev - it is gone.
Creating scripts from database changes:
I could record, what wordpress did, while I was installing plugin via MySQL binary log.
The problem is, that one can get all users in one database query and then add some metadata with another using ids. This means, that binary log records query with a bunch of ids. If new user registered during process - it is gone.
Recording configuartion changes with selenium IDE:
I can then export test suite to python and replay with changed host address. It could work, but it seems rather like workaround, then a solution.
Modifying all the plugins so that they are configured by php files:
This seems legit, but might create quite a lot work.
Can you tell me, how do you automate wordpress deployments with database changes?
There is a couple of similar questions on SO:
Managing Wordpress blog on development and live environment
Wordpress Dev Environment Migration
but these are rather basic questions and they do not solve my problem.
Did you try with WP Migrate DB Pro?
I use this plugin for db transfer.

Categories