Changed server account and php scripts no longer work - php

I inherited a website that recently changed hosting accounts. Both were on virtual servers. On the new account several of the php scripts have stopped working. They were working before the change.
I've already tried changing register_globals and that didn't work.
What other types of settings can I try changing? Things that might stop scripts from working on a different server.
I know this is generic, but I just need some ideas of where to start to troubleshoot the problem.
Thanks.

Check the version of php that the new server is running by echoing phpinfo(). That sometimes tends be the case, if you are not missing other things such as file paths and others.

Related

Wordpress post/pages not publishing immediately -> missed schedule instead

I experienced strange behaviour of wordpress. Whenever I want to publish a post or page it says "Missed schedule". But I have no intention to schedule. I want to publish something directly.
Some times later (I assume when wp-cron runs) the pages gets published. But this bahaviour is immense problem for me developing the page, as the customizer crashes and is not able to update changes. Usually a "immediately" published post should be published, well, immediately. Never had this issue before on other systems. I do not need the scheduling function at all, but now I am forced to schedule anything?
Setup:
CentOS 7, PHP 7.4, Apache 2.4, MySQL (Fresh Setup of the LAMP Server) Als tried PHP 7.3/MariaDB.
Installation of latest wordpress 5.5.1 without any issues (but also tests with older versions caused the problem)
Check of Servertime vs. Wordpress timezone - everything fine here
Standard Theme adter installation, no plugins active!
Checked the rights for apache user, everything fine (755/644)
Checked the "run wp cron" plugins, but thats not solving the issue.
I assume there is some problem with wp-cron or the db but most probably my server setup is missing some dependency/configuration? (But I tried different Tutorials for installation, so must be something very basic...)
Somehow it seems like nobody every experienced this issue, as I googled for hours... Hopefully sombody with more backend experience can explain whats happening here and how to fix it.
Here is a picutre of how the workflow looks like
If you are publishing without schedule Wordpress will publish it unless something prevents it from happening.
There is a known issue where if you use localhost server may have issues with Gutenberg so for test purpose try https://wordpress.org/plugins/classic-editor/ and see if its fixing it for you. If it does its probably a problem with your server settings preventing the rest api to work or issue with wp-cron.php.
Same problem here with all installations of WP in a VPS.
No useful info on google.
Somebody has find a workarround: change Centos+plesk to Ubuntu+Plesk. This seems to work fine.
I have finally found a solution to the problem. Changing the system is not a useful option for me.
In this forum they explain the problem: here
And it brings us an explanation in the plesk forums: here
It is basically a problem in CentOS7, the UTC file is not valid and this causes problems in publishing changes in WordPress.
The problem is solved by replacing that file "/usr/share/zoneinfo/UTC" with a correct copy (I have taken it from another server with CentOS6).
And everything works correctly.
You don't even need to reboot.

Wamp Server not starting in Windows 10 64-bit

I was writing some PHP code for my web application recently. I was trying to test sending an e-mail from a contact form on a local server (by using a variety of methods, including SendMail). None of them worked (though it may be code-related but I don't know yet). I basically restarted Apache/MySQL several times throughout testing. At one point when I was changing the configurations for SendMail, I was unable to re-start Apache & MySQL after stopping them. The icon remained red. Every time I try to start Apache, nothing would happen and the icon still remains red. I tried doing it manually from Services but it's giving me an error. It has always worked in the past, so I am not sure what's happening now or whether or not changing some of the SMTP configurations on php.ini or sendmail.ini and installing these mail server tools messed something up?
Anyone have any suggestions on how to fix/troubleshoot this? I am pretty new to server-side development. I appreciate the help!
It could be a hundred different things, do what welshGaz said and check your logs. If you're still stuck after that, you have the following options:
Uninstall/Reinstall WAMP
Try an alternative to WAMP such as XAMPP
Spin up a virtual environment using virtual box and ubuntu
Spin up a server on Amazon Web Services, Heroku, etc.
These are options are of the last-resort variety, but if you're in a pinch and don't have time to troubleshoot, one of these options might be a faster way to get back up and running.
I think the first place to go would be the WAMP logs. On Windows these can be found under the root_application_install_directory/logs. For example on my Windows 10 machine I can find them under C:\wamp64\logs.
You should find all logs from Apache, PHP etc. placed here. Having a look at those may help you get closer to the cause of your issue and why the server is not starting.

Sugar CRM saves index.php file after migrating to new server

i transferred a website over to a new server. as far as i can tell, everything came with it. databases, SSL, everything. It was a cpanel package script:
/scripts/pkgacct fileserv
its Sugar CRM. it still works on the old server, but when i try to use it on the new server, it just downloads index.php
and leaves me at a blank screen. any ideas? i was thinking possibly a PHP or Apache module or something, but I've never set up sugar CRM myself, and in setup guides, i couldn't find any special modules or anything that I need.
this is a problem i've dealt with before, but all the typical fixes aren't working. there are other websites running, so PHP and apache are working just fine. I edited .htaccess and everything too. but any suggestions at all would be very helpful. assume i've done absolutely nothing so far, just in case I missed something obvious.
Yeah it's probably apache, either A) the new server does not have PHP installed and apache does not have the module installed either or B) apache does not have the module installed to execute php scripts.
I think the comment under your question is heading in the right direction:
PHP code is not being executed, instead code shows on the page

Existing PHP sites on a CentOS server configured to use Apache are working, but new sites will not parse PHP

I have an issue with my CENTOS server. PHP will not parse. php -v shows that PHP 5.3 is installed.
Things I've tried:
Uninstalling httpd, and reinstalling it
uninstalling PHP and reinstalling it (php53u)
My http.conf contains the php directive lines required for PHP5, but it seems I have to enable these directive lines in my magento site .htaccess (1and1 related commented lines) to get any effect. When that happens, PHP files are no longer being downloaded, but the source is visible in my browser.
I did do a test trying to use an existing domain and point it to the new sites root directory, but the issue persists
I've looked around the internet for the answer and on Stack Overflow, my problem seems to be different than other users, because my original sites still work. The only sites I have a problem with are new sites.
Other things I've noticed:
Magento sites on the server are still running fine. If I create a new subdomain site, I get the same PHP will not parse error.
The existing sites DO NOT have the .htaccess php5/1and1 directive lines uncommented.
I did originally have an INNODB issue today on the server. I ended up having to rebuild some sites. The site with the rebuilt database is fine.
What could be the reason as to why existing sites work, even after uninstall and reinstall of php/apache, but new sites don't seem to be configured correctly on setup?
UPDATE:
New Things I've tried:
renamed /etc/php.ini. Original sites still work. New sites still show source. I guess this means that I have 2 php.ini files on the server somehow. After checking, I can only find one.
Enabling short tags in PHP
Other relevant information:
The server is currently at PHP 5.1.6. My sites that worked now correctly show a PHP version error message (Magento sites need 5.2+). The new sites are still not working. I'm also using Plesk.

Install and use PHP for IIS7: WINDOWS 7

I installed Apache, PHP and Apache to be used with PHP. The Apache server was never pointing to localhost, and the localhost always pointed to IIS instead of Apache.
Interestingly, I had a seperate website (explicitly named with somename.com, running locally with default port 80 and upon firing the Apache server the site was being used (instead of localhost) for displaying the Apache-based folders.
However, both are not able to process PHP and I've been trying to get this to work for almost a day now (I thought it wouldn't be too rough on me initially)
So since no matter what change I've made:
Apache configuration to use specific IP, rather than port 80.
Restricted IIS on specific ports, rather than port 80 and all local ports.
Disabled IIS via 'Services' in Administrative Tools.
Forced restart of 'Apache Service' via 'Services' in Administrative Tools (this threw an error). But restarting it via the Apache Http server menu options seemed to work fine.
Installed XAMPP so it will run directly (not sure if I'm using this wrong though, it did seem to start up but again localhost was never pointing to the Apache's 'htdocs' like it's supposed to.
PHP was added to Apache as well as downloaded (both .MSI, .ZIP installed for BOTH Apache and IIS).
No option seems to make the PHP process, it just displays the source code (like in HTML you have the html, head, body tags displayed on the web site instead of actual HTML ). It's pretty frustrating that:
After different attempts to disable IIS, I've not been able to.
Apache has everything configured to run PHP (I have actually done this on a Macbook once a long time back, don't remember if I missed anything though) but it doesn't work.
No errors are thrown, except that localhost is not displayed (I stopped the sites that were on IIS, and localhost points to IIS, any attempts at accessing either the IIS specific folders, or the Apache sites are not working).
Also, several attempts of getting PHP to work on WINDOWS 7 (yes in capital letters) has failed as well. Please help!!! Let me know if any specific details may help in troubleshooting, and I will be glad to provide them.
Well, firstly, apache is obviously now running as you can see the php source.
If you only see php source, assuming the PHP file is of a .php extension, you can boil it down to almost certainly the mime type hasnt been set.
in your apache config there will be lines such as:
AddType application/x-httpd-php .php
if not, add it.
If that doesnt work it would really seem it hasnt heard of PHP at all.
having not got apache on win7 to hand, theres probably a loadmodule line missing, while this is aimed at vista, this may have some ideas.
http://www.wikihow.com/Install-and-Configure-Php-5.2.5-and-Apache-2.2.8-in-Windows-Vista
Just use some prebuilt solution....
I use WAMP, But there are loads out there.

Categories