Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
I would like to ask if there's something wrong to my webhost or with my code.
I successfully try and test all over my custom php website on my localserver using wamp.
As I upload into my webhost (i used crazydomains) and setup the database usernames, passwords etc.
And when the time I accessed it, it says internal server error.
Have you encounter this already?
Based on your comments you are using password_hash() and the php version on the server is 5.4. That is going to lead to fatal errors for an undefined function as password_hash() is available from php 5.5 on.
There is a library to provide forward compatibility for these functions, password_compat.
This will solve your problems where password_hash() is concerned, but if you run into more problems, you should add error handling and display them to see what is going on. To do that, just add this to the top of your script:
ini_set('display_errors',1);
error_reporting(E_ALL | E_STRICT);
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
Issue: I made an application without problems working on localhost where I debuged it. But when I uploaded it on server in internet (my school server) few SQL didnt work, there were no PHP error messages and i tested SQL code in phpMyAdmin(on server) and there it worked.
Guys,can you help me solve this please?
The main problem is that you cannot provide any useful information about whats wrong. In this case, we need to tell PHP that for any and every problem please send it down to the client on page load. Normally in production this is precisely what you do not want to do but in this case- we need it.
Put the code below at the beginning of your index.php file, or whatever file your web server is configured to send requests to:
ini_set('display_startup_errors',1);
ini_set('display_errors',1);
error_reporting(E_ALL);
So long as your web server is successfully sending requests there, something should come up on page load that will help us determine the issue.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I'm currently working on a website for a client, but this website is running PHP version 5.2.17.
Can anyone recommend the best way to tackle this? I've experience in HTML/CSS/JS/JAVA with a basic understanding of PHP.
I'm thinking of rebuilding the website with a HTML5 framework and basically dumping this on top of the old PHP pages, integrating the MySQL database and passing through the links to not lose SEO, but ultimately do worry it may affect the site...
I've tried running a WAMP server but as it only goes as low as version 5.3 I get constant errors and the page displays without the CSS and has words overlapping etc.
Images attached.
The errors you are encountering are to do with files which are being included not being found. Check through the code and identify the files that are being requested, then locate those files and correct the file paths, if the files can not be restored then remove the include statements entirely or comment them out, make sure they have been removed from evrrywhere.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I'm trying to create a website with Dreamweaver CS6, which I am doing just fine. On one of my pages, I want the visitor to be able to send me an email. I'm under the impression that I need a web server and PHP installed. Here's what I have tried:
Installed WAMP but couldn't get it to send the email. The errors indicated it didn't recognize PHP
Installed XAMPP. I got a little closer with this one but no luck
Installed Apache web server separately and got it configured. Installed PHP separately and seem to have it configured properly as I can see the PHPInfo page
I am running Windows 7 Ultimate 64bit / Apache 2.2.4 / PHP 5.2.6 (I have these older versions of Apache and PHP because I was following a tutorial and wanted to make sure I could get through it. I've tried downloading several free PHP mail forms to incorporate into this one page, contact.html but I can't get any of them to work. If there is some other way to achieve this I haven't been able to find it and everything I have read indicates you cannot do it with just HTML.
If there is anyone willing to take me through this step-by-step, it would be greatly appreciated.
Php needs to use smtp to send mail on windows. See a previous question here
Apologies as I realise this should be a comment but my rep does not allow me to.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
Recently we have upgraded our PHP version in C-panel to PHP Version 5.4.36. After updation we have run the Easy Apache successfully. After that Some of the websites are getting errors in website. I am giving you some sample examples. Can you please let us know the possibilities and the solutions.
http://www.kopanaacreations.com/bollywood-replica.html
http://supremelaptopservices.com/
Prompt response will be highly appreciated.
Regards,
Subbareddy
The first one is actually an out of memory error, which means that either the images you have uploaded are too big to be processed by the GD module with your current memory settings or there is another error going on there.
The second site has errors because you have strict errors enabled (they are enabled by default on newer version of PHP)
Disabling Strict Errors
See the link above on how to rectify this!
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I'm currently developing an auditing web app using PHP and MySQL. The app was developed locally using XAMPP without any issues. However after deploying it to my host's servers one of the php files that accesses the database using PDO started to generate a 500 internal server error. After some debugging the fetch() function was found to be the source.
// works
$sql="INSERT INTO subsection (section_id) VALUES (:section_id)";
$query=$db->prepare($sql);
$query->execute(array(':section_id'=>$section_id));
// doesn't work
$sql="SELECT audit_id FROM audit
WHERE audit_id < :audit_id
ORDER BY audit_id DESC LIMIT 1";
$query=$db->prepare($sql);
$query->execute(array(':audit_id'=>$audit_id));
$prevAuditId=$query->fetch()[0]; // <-- error generated here
phpinfo() reveals that the host's servers are running PHP version 5.33 and PDO support is enabled. So to summarise, the web app works locally on a XAMPP installation and when hosted PDO appears to function except for the fetch method().
Any clarification on this issue would be greatly appreciated.
The problem is that you're using PHP 5.3, but the array-dereferencing syntax you've used is only allowed from PHP 5.4 and up.
Here's your code:
$prevAuditId=$query->fetch()[0];
The problem is nothing to do with the PDO call, it's caused by the [0] at the end.
Getting an array element from a function call like this is called "dereferencing" the array. PHP 5.3 doesn't support this. If you need to stick with PHP 5.3, you'll have to split it out into two lines:
$auditRecord=$query->fetch();
$prevAuditId=$auditRecord[0];
Alternatively, you could upgrade your server to PHP 5.4 (or later), where your original syntax is valid.
Hope that helps.