Cant load PHP files on MAMP localhost [closed] - php

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I have a project folder that I've been working on with with WAMP on Windows, but I moved everything over to MAMP on the Mac. I've got the project file uploaded to a webspace and everything works fine, so I know the code is fine. I've imported all the MYSQL data from WAMP.
I can access the .html files with no problems on the Mac but when I try to run a .php file I receive the message localhost is currently unable to handle this request. and the error code 500.
I've been searching for hours and can't find a fix for this.
Any ideas as to why I am seeing these messages and cant access any .php files?
Some extra info on the mamp setup:
Apache port: 8888
MYSQL port: 8889

The first thing that comes to mind is making sure that you hit the correct folder. The easiest way is probably by adding a test.php file in your project public root and putting something like <?php echo "hello world"; in there. And then you just browse to localhost:8888/my-project/test.php and check if the world gets greeted.
The second thing I would do is check the error logs. "localhost is currently unable to handle this request." is not very helpful for debugging. You should be able to find apache_error.log and php_error.log inside /Applications/MAMP/logs
Feel free to ask if that didn't help locating the issue, or if you are still stuck...

Related

How to change a webpage from .html to .php [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I have made a webpage using .html and I would now like to change it to .php so I can connect it to a database. I have changed the file extension to .php but now it just opens the actual code in the browser as opposed to opening the website. I have googled it but all I can find is stuff about installing .php on a server, when I am just trying to open the file on my device. I am using Microsoft Edge if that matters. What do I do?
First of all, what you have to understand is php is a server side language whereas html is a client side language. As you might already know, html can be directly interpreted by browser but for php, the case is different. You need to have a server installed.
Moving on to your question How to change html to php!!, it's simple, just change the extension of the file.
To run the file, use local server. There are many options you can choose from. Personally I find Xampp easy to setup for beginner. It's my personal opinion though.
To sum up, to change html from php, install a localhost or local server to your computer, migrate your files to server's run directory. You can find plenty of tutorials on setting up localhost.
If you want to run a PHP file after changing its extension. You need to install xammp or lamp server. In the localhost server, you can view your PHP pages on any browser.

Wordpress : ERROR: "Table Prefix" must not be empty [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
im trying to do a clean install of Wordpress 4.5.2 but running into an error at the database stage. After filling in the correct database details and clicking Submit i get this error:
ERROR: "Table Prefix" must not be empty.
After doing some research some users have fixed the issue by increasing the post_max_size and upload_max_filesize under the PHP settings. I have done this but still get the same error. The apache logs etc. are not pointing torwards any exact error, just giving the 500 error GET /wordpress/wp-admin/setup-config.html?step=2 HTTP/1.0
Im running Plesk 12.5.30 on RHEL7.2.
I have done many Wordpress installs before and this is the first time i have come across this issue. I have wordpress installed on a few other domains on the same server and they are running just fine, although they were not installed on this server merely copied over recently so unsure if the same error would have occured had i clean installed them as well.
Lastly, i have already tried deleting the domain and database and creating them again just incase and still have the same issue.
Any suggestions would be much appreciated.
Thanks
Chris
You need to define table prefix in your wp-config.php file.
Example:
$table_prefix = 'chris_';
In the folder where you install WordPress, there can't be any files. Maybe you have some other files there. Remove all files and try installing WordPress again.

Access Telegram-CLI by php [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I want to access the Telegram-CLI using PHP.
I'm compiled Telegram-CLI and loged in to my account, and its works like a charm.
I installed LAMP ([in Linux], Apache, MySQL, PHP) and i tested them works.
I even installed these [following] PHP packages one-by-one using "Composer" and tested the examples but i couldnt make them run...
Also it seems their forum are abandoned to get my questions answer.
php-client for telegram-cli
A wrapper for Telegram-CLI
PHP Wrapper and Drupal module using Telegram CLI
I have no idea how the "Composer" works and how to make them work?
Could somebody tell me how to make one of them work in simple way.
 
 
 
Edit:
All steps of building Telegram-cli, loging in for first time and run it as deamon has beed completed.
This project has been installed on php project root dir using "Composer".
Example.php file has been moved to web server root directory.
But also unning it cause a 500 Internal server error.
The error line is:
$telegram = new \Zyberspace\Telegram\Cli\Client('unix:///tmp/tg.sck');
notices:
The file has been checked and is already there.
And the telegram-cli is running as a daemon on root user.
Edit 2:
I added a telegramd group and telegramd user assigned to that group.
I detacted that php commands running under apache user account.
I changed the apache user group to telegramd.
But again nothing...
So, Please help me

Laravel setup projects on personal web server [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I have at home a personal web server running apache where I have a /var/www/{project_folder} to serve my websites, where I access them by the other machines by the IP/{project_folder}, nothing new for now. :)
I have some new projects done with laravel, but I only run them at my local machine to use the cli command to serve where it always runs at localhost:{door}
I would like to put that projects at my web server but I'm facing some difficulties because I only have some basic knowledge about apache and I'm having trouble to figure out the configuration.
I believe someone have already done that :)
Thanks in advance.
Assuming that you already have PHP working with Apache, so your httpd.conf file is fully configured so that if you have a file ending with .php will be handled properly.
All you have to do now is place your project in the htdocs folder where you have all normal project in. That's it.
You could install composer and install Laravel with it. For example via
"composer create-project laravel/laravel --prefer-dist".
See here
Now the tricky part:
If you want to access the site via http://localhost/your-project and not via http://localhost/your-project/public, then do this (depending on you OS):
Activate Mod_Alias
Goto '<IfModule alias_module>'
Then add this line inside:
Alias /your-project/ "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/your-project/public/"
In this case you don't need virtual hosts.
Let me know if you have further questions.

wampserver is preventing me from changing config files [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
i have windows 7 home premium 64bit.
So i decided to try out some php, so i downloaded wampserver. First, i tried to change the index file in the www directory, but even when i quit wampserver by right clicking and clicking exit on the wampserver icon, notepad++ says the file is still open in an other application.
So i tried following this tutorial (How to create a Virtual Host in WampServer) but i cant edit the httpd-vhosts.conf file because of the same issue.
thanks in advance
PS:clicking "stop all services" doesnt work either.
edit:
computer restart did not resolve my issue.
notepad says access denied when trying to save the file.
permissions are read/write
Exit wampserver and run again by right clicking the wampserver and choose run as administrator. Then you should be able to stop and start the services.
Open notepad the same way by right clicking it and choosing Run as Administrator. Then you should be able to save the files.
thanks to raouf Athar. later in the tutorial it said that notepad++ needs to run as administrator to change these files, and it seems that instead of saying "needs administrator", notepad simply says that another program is using the file.
thanks to all who tried to help me

Categories