Can't find XAMPP's httpd-xampp.conf file on MacOs Mojave - php

I'm experiencing the problem discussed in this thread: New xampp security concept: Access Forbidden Error 403 - Windows 7 - phpMyAdmin
To solve it I apparently need to make some changes to the httpd-xampp.conf file. I however don't know how to locate it.

Are you guys sure you mounted /lampp?
XAMPP Volumes
If not, please do so.
Then open file at
lampp/etc/extra/httpd-xampp.conf
and edit it at line 20 and add a new one at 42 like this:
# since XAMPP 1.4.3
<Directory "/opt/lampp/phpmyadmin">
AllowOverride AuthConfig Limit
Require all granted
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
and
# <Location /time>
SetHandler modperl
PerlResponseHandler Apache::CurrentTime
Require all granted
Start XAMPP again (mounting of lampp not necessary anymore) and you are good to go.

use find command to know the location of httpd-xampp.conf. enter the following command:
$ sudo find / -iname "httpd-xampp.conf"

Is not that located at: etc/extra/httpd-xampp.conf ?
If not, then just create it, and in the main .conf file (httpd.conf) file, insert such line:
Include etc/extra/httpd-xampp.conf

It is located in the virtual machine running xampp, not the physical hard drive. That being said, I cannot find mine either and am simply using http://localhost:8080 to access phpMyAdmin until I find httpd-xampp.conf.

Having issues setting up xampp on macOs or accessing the config.inc.php or httpd-xampp.conf file.
Note: For macos xampp making use virtual machine under the hood to mount the folder structure on your system.
step 1: you need to follow the instruction step by step on the screen below,
it has image illustration which helps alot
https://www.apachefriends.org/blog/new_xampp_20170628.html
step 2: Click on network tab within the xampp interface then enable one of the
host machine.
step3: Click on the volume tab within the xampp interface then click on mount
then click Explore to have access to the xampp folder or files likes of config.inc.php or httpd-xampp.conf

Related

How to create Laravel development server without use php artisan

I am new to laravel and i have download voyager admin panel for CRUD operations.
actually my folder structure is
testadmin(project name)->vendor->tcg->voyager
when i hit php artisan serve i got http://127.0.0.1:8000 and http://127.0.0.1:8000/admin i will get my admin panel
Can i get the same url without using php artisan serve?when i hit localhost/testadmin/public i got laravel page and http://localhost/testadmin/public/admin i will get admin page but complete css is missing.how can i access my admin page without artisan serve?please help me.any help would be appreciated
You can use Valet or Homestead
I don't know if you are on Windows env, but I am sure there is an option on Windows too. Artisan serve is for quick checks, I wouldn't use it for development.
You need to change the httpd.conf file in the /etc/httpd/conf/ folder, if you are on linux.
Uncomment or add the line Include conf/extra/httpd-vhosts.conf so that you can add your own virtual hosts
Then in the file change /etc/httpd/conf/extra/httpd-vhosts.conf Add the following lines
<VirtualHost *:80>
DocumentRoot "/var/www/html/testadmin/public"
ServerName YOUR_WEBSITE_NAME
</VirtualHost>
then save. now restart the Apache server
service httpd restart
Hope this solves your problem. this may be a bit complex but i tried something similar on windows and it worked.

Running php files stored on OneDrive

I am developing a php project, having the project files stored on OneDrive so that I can access them from anywhere.
I have set up XAMPP, with a VirtualHost pointing to my project folder inside OneDrive so that I can run it in my browser.
This has been working great up until yesterday, when OneDrive started crashing and I had to reinstall it. Now I'm no longer able to run php files stored on OneDrive.
I get this error in my browser:
Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
Fatal error: Unknown: Failed opening required 'D:/OneDrive/MyProject/index.php' (include_path='C:\xampp\php\PEAR') in Unknown on line 0
My OneDrive folder is D:\OneDrive. If I set up a VirtualHost pointing to D:\, I am able to run files such as D:\index.php or D:\MyProject\index.php in my browser. But I'm not able to run files such as D:\OneDrive\index.php or D:\OneDrive\MyProject\index.php.
Does anyone have an idea what might cause this issue?
Edit:
The issue does not seem to be related to .htaccess, as the behavior is independent of whether a .htaccess file exists in the project folder or not.
Here is my VirtualHost, in case anyone is interested:
<VirtualHost *:80>
ServerAdmin webmaster#myproject.com
DocumentRoot "D:/OneDrive/MyProject/"
ServerName myproject.com
ServerAlias www.myproject.com
<Directory "D:/OneDrive/MyProject/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Require local
</Directory>
</VirtualHost>
I've not been able to solve the issue, but I've found a workaround:
Store the project files outside of OneDrive.
Make a symbolic link in the OneDrive folder to the project folder outside of OneDrive.
With this setup I'm able to run my PHP application, since the project files are not physically located in the OneDrive folder, and the project files are still uploaded and backed up on OneDrive due to the symbolic link.
This bug is not fixed still. After Windows 10 May 2019 Update, the bug reappeared and it's not fixed by Microsoft.
I think you just have to right-click OneDrive's icon in the Notification area, choose Settings > Settings > and uncheck Files on Demand.
Optionally, you can leave that, but just right click the folder in OneDrive that's giving you grief and choose the option to always keep a local copy of the folder.
I think is fixed now (2018-11-26) - Now, sites are working again in OneDrive. I'm sure it was a OneDrive app problem that was fixed recently.

localhost now 403 Forbidden OS X Apache

http://mallinson.ca/post/osx-web-development/
I was following the above guide for setting up the OS X Mavericks local development environment on my new mac and originally everything worked out. Not really sure what happened afterwards, but after leaving my computer for sometime, working on other stuff, and maybe rebooting, I now get a Forbidden -- You don't have permission to access / on this server. (403 Forbidden in title bar) when I try to go to ANYTHING.dev, localhost, 127.0.0.1, etc. Since I didn't change any of the files mentioned in the article since it was last working, my guess is this is some sort of permissions issue.
The only file from this entire setup that is different than what is in the guide is httpd-vhosts.conf found in /private/etc/apache2/extra/, which was simply changed to match my directories rather than the author's. Just in case, you can view the file here -- http://pastebin.com/wcr1fdZe (I have 2 hard drives, SSD boot and HDD for storage and named storage, so I found it reasonable to put the www directory on the HDD)
By the way, that directory is as follows /Volumes/Storage/www/sites/home/wwwroot where sites is the only folder in www and home is the only folder in sites and wwwroot is empty.
Can someone please help me fix this?
Note: I actually also tried going through this guide earlier and it worked originally and then it failed randomly with the same 403, so I reinstalled OS to see and it worked and failed again in a similar manner. I have tried flushing dns cache and restarting apache server via terminal. I'm new to this stuff so please provide specific commands, paths, etc. when something needs to be done, and ask if you need more details.
> UPDATE: so #matanco has got this figured out for me if you look below, but there's still ONE problem... localhost is working, BUT home.dev, me.dev, anything.dev,etc. still has 403
just follow those steps this is simple permission issue:
cd /usr/local/apache2/htdocs/ (if you changed it navigate to your folder)
chmod 644 .
chmod +x .
hope that will solve your problem.
EDIT::
add this to your httpd-vhosts.conf
<VirtualHost *:80>
ServerName localhost
DocumentRoot /Library/WebServer/Documents/
</VirtualHost>

problem installing CakePHP on Linux

I have downloaded the CakePHP from it's site then I copied the files in srv/www/htdocs
renamed the folder to first_app
Here is the output(error and warnings that shows me):
Release Notes for CakePHP 2.0.0-dev.
Fatal error: Class 'Debugger' not found in /srv/www/htdocs/first_app/cake/libs/view/pages/home.ctp on line 26
also the tutorial tells me that I must have this:
Apache server with mod_rewrite
I didn't know how to find it and install it?
is that causing this problem?
I want to know how to add "another" root without having problem
I used this and no result:
<Directory /srv/www/htdocs/first_app/app/webroot>
Options None
AllowOverride All
Order deny,allow
Deny from all
</Directory>
also I changed the /etc/apache2/server-default.conf
I changed allow override None to Allow override All
in the part of this:
<Directory "/srv/www/htdocs">
chmod -R 0777 /srv/www/htdocs/first_app/app/tmp/
This makes the tmp dir writable for everybody (on your machine) so also for the web server. If you want to limit access, first try this, then browse to your CakePHP install, and then check in the cache dir which files have been created and what's the owner and group of those files.
The tmp dir contains more than just the cache dir, it also contains sessions and logs. Anything outside of /srv/www/htdocs/first_app/app/tmp/ does not need to be writable for the server, anything inside that folder should be writable.
The default CakePHP install comes with .htaccess files. You do need those files. They redirect every request to localhost/first_app (or any other dir your is installed in) into the webroot, so you don't have to do that yourself. You need to have AllowOverride All in your apache config. See here for instruction on how to enable that.
Please Go through these links
http://www.youtube.com/watch?v=9stiBWz71Ts
http://ubuntu-linux-apache-mysql-php.blogspot.com/2008/12/how-to-install-cakephp-on-linux-ubuntu.html
http://groups.google.com/group/cake-php/browse_thread/thread/3ba763933544ece
It may help you.
same problem on mac. on mac, i just right clicked on the directory it was concerned about and changed the permissions so that everyone could read/write, and clicked apply to enclosed files/folders.
I used to use linux but i'm not sure exactly how to do this, but hopefully this will get you on the right track? i assume that the command you posted changes the permissions of that folder, but maybe you need to change the permissions of the files and folders inside.

Using PHP with the default Mac Apache + PHP installation

I'm starting to unravel the mysteries of PHP and I configured the pre-installed Snow Leopard PHP and activated the Apache server in the system preferences. So far so good: it works if you put a PHP file in your ~/Sites directory.
Since I've my projects in a code/projects directory I created a symbolic link from the ~/Sites dir to the code/projects/one-project/php-dir and bang!, a 403 error: access forbidden.
I've been changing the permissions of the dirs to 777, but no luck.
Is anyone using the default Snow Leoapard configuration for PHP development and if so, how do you link to your codebase?
Thanks in advance,
Juan
Off the top of my head: it might be the FollowSymLink option in the Options directive of Apache (http://httpd.apache.org/docs/2.0/mod/core.html#options).
That might work if you set FollowSymLinks in your Apache config, but I suggest putting the PHP files under the web root directly.
One good method is to put the presentation files under the web root, and include/require any libraries directly from where they are in the code/projects directory (assuming that dir is readable by the web server user). The include dir shouldn't be writable by the web server, for security. Keep it owned by your user account, and set the permissions to 744.
I presume you have ~/code/projects/projectA/php-dir and ~/sites/php-dir
You need to make sure that the directory above the directory you're sym-linking is readable by the webserver. In this case you need to set the permissions on the folder to 755. Or at least that solved things for me.
you'll most likely need to add a Directory directive to your httpd.conf file as well...
<Directory code/projects/one-project/php-dir>
order allow,deny
allow from all
</Directory>
Above configuration allows access from all IP's, all hosts.
I myself use macports, I find it better since it isolates everything in the /opt directory. But it's a bit of work to get it running...

Categories