PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, January 2, 2022

[FIXED] Failed to access Symfony API routes and getting Symfony strating page

 January 02, 2022     mamp, symfony     No comments   

Issue

I've recently switched to mac and i'm trying to setup MAMP enivrement and a Symfony based API. The problem for now is that i can't access routes all i can get is the Symfony welcome page.

here is my httpd-vhosts.conf file:

<VirtualHost *:80>
    DocumentRoot /Applications/MAMP/htdocs
    ServerName localhost
</VirtualHost>

<VirtualHost *:80>
 DocumentRoot /Applications/MAMP/htdocs/syndico-api/public/
 ServerName syndico-api.local
 ServerAlias www.syndico-api.local
 DirectoryIndex /index.php
  <Directory /Applications/MAMP/htdocs/syndico-api>
    AllowOverride All
    Order Allow,Deny
    Allow from All
  </Directory>
</VirtualHost>

Thanks!


Solution

I just found that i needed to add an Alias in the httpd.config

Alias /api "/Applications/MAMP/htdocs/syndico-api/public/index.php"

i can get now to the api by adding /api to the local address.

thanks everyone!



Answered By - B. Mohammad
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing