Php\Ubuntu virtual links - php

I have latest Ubuntu 18, also Apache2, php 7.2, mysql.
I have rather old simple php application, written on php4 (at least not older than php5).
I have a task to run this application in this environment, to install php4 is not a variant. Possibly there are some compability mode to run this application by php7.2 as php4?
I succeded to open index.php in FireFox, but also it seems, that it is not shown correctly. I run that application also on Windows\IIS and it works perfectly. But on Ubuntu Application has a menu and i see only part of it. Also any item in that menu is created through localization links, like:
application\en\sitemap
application\en\news
Physically i have folders sitemap, news and etc, just under application root folder. But FireFox is not able to open application\en\news, because it seems it is trying to reach folder EN, which is not exist, of course. So neither menu item could be opened. Though on Windows it works from the start!
Tell me, please, direction for futher search.
Is there a compability mode php7.2-php4?
How should this virtual links en-ru work - should i configure php or there should be some points in application config.php for this issue?
Thanks

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/

Identical Zend Navigation code rendering differently on different environments

Anyone got ANY idea what could be causing an issue with Zend Navigation. My environments are provisioned through chef and are the same OS etc, same apache setups etc. On my local Ubuntu VM, my webapp renders correctly. The SAME code fails to render the navigation on my TEST VM (on AWS). When I say the same, I've checked and double checked (and is all deployed through PHING), including SCPing the no-displaying-correctly-code off TEST back onto my box, where it then works correctly.
I'm totally stuck. Does anyone know any low level quirks about how Zend renders nav? DOes it write to temp files or something (long shot). The issue is a routing one IMO. The menu doesn't think it is active, yet is using the same routes.ini file as my dev environment, where is it fine.
I've tried changing the environment settings (development, testing) etc but nothing. It can't be the DATA as there is no impact on routing.
Really appreciate any insight..
SOLUTION!
Ahh haaaa. The nav appears to have been broken by a revision of Zend. The reason that was not seen locally, is because I am using Vagrant to manage by VM locally. The mounted folder is , of course, a read-ony filesystem, so my "ln -s -f symlink" to the correct vendor of Zend was silently failing in my script, but working on LIVE on AWS - hence they were using different Zend versions and the new release which breaks my nav (!ANother story) was only seen on Live...! Here end-eth the lesson to self. ALWAYS halt-on-failure in your deployment scripts

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"

WindowsAzure: Develop on deployed PHP Files

I work a lot with the WindowsAzure4E(clipse) IDE. And it's always pain to wait for the local test deployment)
Isn't there a way to develop on the deployed PHP files which must be stored somewhere to inetput or something else?
thx for your ideas.
Yes! In fact, I just got this working myself yesterday.
After installing PHP 5.3 with CGI support for IIS (making the necessary php.ini modifications of course), I simply created a new site in IIS that mapped to a role in the workspace for my Eclipse project.
Keep in mind that there's one hiccup to this and that is that the php_azure.dll file, used to access the service configuration and mount azure drives, was built to run in the azure fabric (either development or hosted). In my case, I don't NEED these features so I removed referrences to things like getconfig and poof the project loads in IIS just fine. I only need to make sure I start Azure Storage prior to launching the application.
I've been told that some folks are able to update their systems path environment variable with the location of the azure diagnostics dll (diagnostics.dll) and have it work without this modification. But this route didn't work for me. :(
I'll actually be blogging on this more this weekend as it took me a week of evenings to get things sorted out.
I found out that after the deployment the project files are copied to the folder ServiceDefinition.csx.
When you now edit the source code in this place, you can see the changes directly, without another deployment.

Breakpoint not firing using PHP/XAMPP/NetBeans/Moodle

Bit of an obscure one this. My setup is all running on my local Windows machine; I've got NetBeans IDE installed, a local XAMPP server with XDebug running, and an installation of Moodle with some custom addons in the mod directory.
I can happily create breakpoints in PHP pages (including the main Moodle ones), but any breakpoints I place on php files in the mod directory never fire (on my mods, or any of the inbuilt ones). I thought Moodle might be doing some "magic" to display files in the mod directory, but my browser shows the url as http://localhost/moodle/mod/view.php - and that's the file I've set my breakpoint in.
Has anyone got any experience with debugging Moodle addins, or could possible point me in the direction of how to troubleshoot the breakpoint not firing? I've tried the Moodle site, but can't find anything relevent.
Actually, I think I've figured it out. If I tell it to debug that particular file it will 404 (it doesn't put the directories in, guess it's a bug), but if I then manually go to http://localhost/moodle/mod/view.php?XDEBUG_SESSION_START=netbeans-xdebug (which errors, no parameters are being passed in), and THEN manually navigate to Moodle then my mod breakpoints fire correctly.
All very bizarre, but it seems to be a usable workaround. I'm guessing the mods are running under some kind of different PHP session.
I'll keep this answer here in case anyone else has this bizarre problem.

Categories